ACPI / AC: convert ACPI ac driver to platform bus

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ideapad_laptop: introduce #ifdef CONFIG_PM_SLEEP for PM specific code

ideapad_acpi_resume() and ideapad_pm is meaningful
only if CONFIG_PM_SLEEP is set.
Thus introduce #ifdef for this piece of code.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ideapad_laptop: introduce struct acpi_device pointer to ideapad_private structure

Introduce struct acpi_device pointer to ideapad_private structure.
At the same time, replace all adevice with adev to be short and consistent.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ideapad_laptop: convert internal function calls to use ideapad_private as parameter

As struct ideapad_private has all the information needed for any operations,
convert ideapad_register_rfkill()/ideapad_unregister_rfkill() and
ideapad_sync_touchpad_state() to use struct ideapad_private as the parameter,
to be consistent with the others.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ideapad_laptop: remove ideapad_handle and ideapad_priv

The current code use ideapad_handle and ideapad_priv to store
some information for the ideapad device.
But as they are global/static variables, the driver will be broken
if there are more than one ideapad ACPI device node on a platform.
Although this does not happen for now and may not happen in the future,
but still, this is a software bug.

Remove these two variables in this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ideapad_laptop: convert ideapad device/driver to platform bus

This patch does two things,
 1. enumerate the ideapad device node to platform bus.
 2. convert the current driver from ACPI bus to platform bus.

Note, with this patch, the platform device node created by ACPI,
with the name VPC2004:00, is used as the parent device of
the input, backlight, rfkill sysfs class device.
Plus the ideapad_platform private sysfs attributes,
i.e. camera_power and fan_mode, are also moved to the new
platform device node.

The previous platform device node "ideapad" is removed.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Merge branch 'acpi-conversion-next' into bleeding-edge

* acpi-conversion-next:
  ideapad_laptop: convert ideapad device/driver to platform bus
  ideapad_laptop: remove ideapad_handle and ideapad_priv
  ideapad_laptop: convert internal function calls to use ideapad_private as parameter
  ideapad_laptop: introduce struct acpi_device pointer to ideapad_private structure
  ideapad_laptop: introduce #ifdef CONFIG_PM_SLEEP for PM specific code
  ACPI / AC: convert ACPI ac driver to platform bus
Merge branch 'acpi-fixes-next' into bleeding-edge

* acpi-fixes-next:
  ACPI / scan: fix typo in comments of acpi_bus_unregister_driver()