Re: [PATCH v11 6/9] libata: handle power transition of ODD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 06, 2013 at 10:48:26AM +0800, Aaron Lu wrote:
> +bool zpodd_zpready(struct ata_device *dev)
> +{
> +	struct zpodd *zpodd = dev->zpodd;
> +	return zpodd->zp_ready;
> +}
> +
> +void zpodd_pre_poweroff(struct ata_device *dev)
> +{
> +	struct zpodd *zpodd = dev->zpodd;
> +
> +	zpodd->powered_off = true;
> +	device_set_run_wake(&dev->sdev->sdev_gendev, true);
> +	acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, true);
> +}
> +
> +void zpodd_pre_poweron(struct ata_device *dev)
> +{
> +	struct zpodd *zpodd = dev->zpodd;
> +
> +	if (zpodd->powered_off) {
> +		acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, false);
> +		device_set_run_wake(&dev->sdev->sdev_gendev, false);
> +	}
> +}
> +
> +void zpodd_post_resume(struct ata_device *dev)
> +{
> +	struct zpodd *zpodd = dev->zpodd;
> +
> +	if (!zpodd->powered_off)
> +		return;
> +
> +	zpodd->powered_off = false;
> +
> +	if (zpodd->from_notify) {
> +		zpodd->from_notify = false;
> +		if (zpodd->drawer)
> +			eject_tray(dev);
> +	}
> +
> +	zpodd->last_ready = 0;
> +	zpodd->zp_ready = false;
> +}

I would really appreciate some comments at least on functions visible
outside zpodd.c.  Please add proper function comments explaining what
they're doing to achieve what.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux