From 76693f5705828aa63c5cc52e407761964c6a4280 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Fri, 20 Aug 2021 14:04:52 +0300 Subject: platform/x86: intel_atomisp2: Move to intel sub-directory Move Intel AtomISP v2 drivers to intel sub-directory to improve readability. Signed-off-by: Kate Hsuan Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210820110458.73018-15-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede --- drivers/platform/x86/Kconfig | 34 ------- drivers/platform/x86/Makefile | 2 - drivers/platform/x86/intel/Kconfig | 1 + drivers/platform/x86/intel/Makefile | 1 + drivers/platform/x86/intel/atomisp2/Kconfig | 43 ++++++++ drivers/platform/x86/intel/atomisp2/Makefile | 9 ++ drivers/platform/x86/intel/atomisp2/led.c | 116 ++++++++++++++++++++++ drivers/platform/x86/intel/atomisp2/pm.c | 143 +++++++++++++++++++++++++++ drivers/platform/x86/intel_atomisp2_led.c | 116 ---------------------- drivers/platform/x86/intel_atomisp2_pm.c | 143 --------------------------- 10 files changed, 313 insertions(+), 295 deletions(-) create mode 100644 drivers/platform/x86/intel/atomisp2/Kconfig create mode 100644 drivers/platform/x86/intel/atomisp2/Makefile create mode 100644 drivers/platform/x86/intel/atomisp2/led.c create mode 100644 drivers/platform/x86/intel/atomisp2/pm.c delete mode 100644 drivers/platform/x86/intel_atomisp2_led.c delete mode 100644 drivers/platform/x86/intel_atomisp2_pm.c (limited to 'drivers/platform/x86') diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 935116ef2df9..6de0d374ba16 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -668,40 +668,6 @@ config THINKPAD_LMI source "drivers/platform/x86/intel/Kconfig" -config INTEL_ATOMISP2_LED - tristate "Intel AtomISP2 camera LED driver" - depends on GPIOLIB && LEDS_GPIO - help - Many Bay Trail and Cherry Trail devices come with a camera attached - to Intel's Image Signal Processor. Linux currently does not have a - driver for these, so they do not work as a camera. Some of these - camera's have a LED which is controlled through a GPIO. - - Some of these devices have a firmware issue where the LED gets turned - on at boot. This driver will turn the LED off at boot and also allows - controlling the LED (repurposing it) through the sysfs LED interface. - - Which GPIO is attached to the LED is usually not described in the - ACPI tables, so this driver contains per-system info about the GPIO - inside the driver, this means that this driver only works on systems - the driver knows about. - - To compile this driver as a module, choose M here: the module - will be called intel_atomisp2_led. - -config INTEL_ATOMISP2_PM - tristate "Intel AtomISP2 dummy / power-management driver" - depends on PCI && IOSF_MBI && PM - depends on !INTEL_ATOMISP - help - Power-management driver for Intel's Image Signal Processor found on - Bay Trail and Cherry Trail devices. This dummy driver's sole purpose - is to turn the ISP off (put it in D3) to save power and to allow - entering of S0ix modes. - - To compile this driver as a module, choose M here: the module - will be called intel_atomisp2_pm. - config INTEL_HID_EVENT tristate "INTEL HID Event" depends on ACPI diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index dd3f1e683f0d..dccd7ecaae6a 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile @@ -71,8 +71,6 @@ obj-$(CONFIG_THINKPAD_LMI) += think-lmi.o # Intel obj-$(CONFIG_X86_PLATFORM_DRIVERS_INTEL) += intel/ -obj-$(CONFIG_INTEL_ATOMISP2_LED) += intel_atomisp2_led.o -obj-$(CONFIG_INTEL_ATOMISP2_PM) += intel_atomisp2_pm.o obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o obj-$(CONFIG_INTEL_INT0002_VGPIO) += intel_int0002_vgpio.o obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o diff --git a/drivers/platform/x86/intel/Kconfig b/drivers/platform/x86/intel/Kconfig index 2622653af37a..9d0bc76a8948 100644 --- a/drivers/platform/x86/intel/Kconfig +++ b/drivers/platform/x86/intel/Kconfig @@ -16,6 +16,7 @@ menuconfig X86_PLATFORM_DRIVERS_INTEL if X86_PLATFORM_DRIVERS_INTEL +source "drivers/platform/x86/intel/atomisp2/Kconfig" source "drivers/platform/x86/intel/int1092/Kconfig" source "drivers/platform/x86/intel/int33fe/Kconfig" source "drivers/platform/x86/intel/int3472/Kconfig" diff --git a/drivers/platform/x86/intel/Makefile b/drivers/platform/x86/intel/Makefile index f5ac4a5f953f..080589b3082d 100644 --- a/drivers/platform/x86/intel/Makefile +++ b/drivers/platform/x86/intel/Makefile @@ -4,6 +4,7 @@ # Intel x86 Platform-Specific Drivers # +obj-$(CONFIG_INTEL_ATOMISP2_PDX86) += atomisp2/ obj-$(CONFIG_INTEL_SAR_INT1092) += int1092/ obj-$(CONFIG_INTEL_CHT_INT33FE) += int33fe/ obj-$(CONFIG_INTEL_SKL_INT3472) += int3472/ diff --git a/drivers/platform/x86/intel/atomisp2/Kconfig b/drivers/platform/x86/intel/atomisp2/Kconfig new file mode 100644 index 000000000000..35dd2be9d2a1 --- /dev/null +++ b/drivers/platform/x86/intel/atomisp2/Kconfig @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Intel x86 Platform Specific Drivers +# + +config INTEL_ATOMISP2_PDX86 + bool + +config INTEL_ATOMISP2_LED + tristate "Intel AtomISP v2 camera LED driver" + depends on GPIOLIB && LEDS_GPIO + select INTEL_ATOMISP2_PDX86 + help + Many Bay Trail and Cherry Trail devices come with a camera attached + to Intel's Image Signal Processor. Linux currently does not have a + driver for these, so they do not work as a camera. Some of these + camera's have a LED which is controlled through a GPIO. + + Some of these devices have a firmware issue where the LED gets turned + on at boot. This driver will turn the LED off at boot and also allows + controlling the LED (repurposing it) through the sysfs LED interface. + + Which GPIO is attached to the LED is usually not described in the + ACPI tables, so this driver contains per-system info about the GPIO + inside the driver, this means that this driver only works on systems + the driver knows about. + + To compile this driver as a module, choose M here: the module + will be called intel_atomisp2_led. + +config INTEL_ATOMISP2_PM + tristate "Intel AtomISP v2 dummy / power-management driver" + depends on PCI && IOSF_MBI && PM + depends on !INTEL_ATOMISP + select INTEL_ATOMISP2_PDX86 + help + Power-management driver for Intel's Image Signal Processor found on + Bay Trail and Cherry Trail devices. This dummy driver's sole purpose + is to turn the ISP off (put it in D3) to save power and to allow + entering of S0ix modes. + + To compile this driver as a module, choose M here: the module + will be called intel_atomisp2_pm. diff --git a/drivers/platform/x86/intel/atomisp2/Makefile b/drivers/platform/x86/intel/atomisp2/Makefile new file mode 100644 index 000000000000..96b1e877d1f1 --- /dev/null +++ b/drivers/platform/x86/intel/atomisp2/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Intel x86 Platform Specific Drivers +# + +intel_atomisp2_led-y := led.o +obj-$(CONFIG_INTEL_ATOMISP2_LED) += intel_atomisp2_led.o +intel_atomisp2_pm-y += pm.o +obj-$(CONFIG_INTEL_ATOMISP2_PM) += intel_atomisp2_pm.o diff --git a/drivers/platform/x86/intel/atomisp2/led.c b/drivers/platform/x86/intel/atomisp2/led.c new file mode 100644 index 000000000000..5935dfca166f --- /dev/null +++ b/drivers/platform/x86/intel/atomisp2/led.c @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Driver for controlling LEDs for cameras connected to the Intel atomisp2 + * The main purpose of this driver is to turn off LEDs which are on at boot. + * + * Copyright (C) 2020 Hans de Goede + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* This must be leds-gpio as the leds-gpio driver binds to the name */ +#define DEV_NAME "leds-gpio" + +static const struct gpio_led atomisp2_leds[] = { + { + .name = "atomisp2::camera", + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, +}; + +static const struct gpio_led_platform_data atomisp2_leds_pdata = { + .num_leds = ARRAY_SIZE(atomisp2_leds), + .leds = atomisp2_leds, +}; + +static struct gpiod_lookup_table asus_t100ta_lookup = { + .dev_id = DEV_NAME, + .table = { + GPIO_LOOKUP_IDX("INT33FC:02", 8, NULL, 0, GPIO_ACTIVE_HIGH), + { } + } +}; + +static struct gpiod_lookup_table asus_t100chi_lookup = { + .dev_id = DEV_NAME, + .table = { + GPIO_LOOKUP_IDX("INT33FC:01", 24, NULL, 0, GPIO_ACTIVE_HIGH), + { } + } +}; + +static const struct dmi_system_id atomisp2_led_systems[] __initconst = { + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), + }, + .driver_data = &asus_t100ta_lookup, + }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"), + }, + .driver_data = &asus_t100ta_lookup, + }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100CHI"), + }, + .driver_data = &asus_t100chi_lookup, + }, + {} /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(dmi, atomisp2_led_systems); + +static struct gpiod_lookup_table *gpio_lookup; +static struct platform_device *pdev; + +static int __init atomisp2_led_init(void) +{ + const struct dmi_system_id *system; + + system = dmi_first_match(atomisp2_led_systems); + if (!system) + return -ENODEV; + + gpio_lookup = system->driver_data; + gpiod_add_lookup_table(gpio_lookup); + + pdev = platform_device_register_resndata(NULL, + DEV_NAME, PLATFORM_DEVID_NONE, + NULL, 0, &atomisp2_leds_pdata, + sizeof(atomisp2_leds_pdata)); + if (IS_ERR(pdev)) + gpiod_remove_lookup_table(gpio_lookup); + + return PTR_ERR_OR_ZERO(pdev); +} + +static void __exit atomisp2_led_cleanup(void) +{ + platform_device_unregister(pdev); + gpiod_remove_lookup_table(gpio_lookup); +} + +module_init(atomisp2_led_init); +module_exit(atomisp2_led_cleanup); + +/* + * The ACPI INIT method from Asus WMI's code on the T100TA and T200TA turns the + * LED on (without the WMI interface allowing further control over the LED). + * Ensure we are loaded after asus-nb-wmi so that we turn the LED off again. + */ +MODULE_SOFTDEP("pre: asus_nb_wmi"); +MODULE_AUTHOR("Hans de Goede + * + * Based on various non upstream patches for ISP support: + * Copyright (C) 2010-2017 Intel Corporation. All rights reserved. + * Copyright (c) 2010 Silicon Hive www.siliconhive.com. + */ + +#include +#include +#include +#include +#include +#include + +/* PCI configuration regs */ +#define PCI_INTERRUPT_CTRL 0x9c + +#define PCI_CSI_CONTROL 0xe8 +#define PCI_CSI_CONTROL_PORTS_OFF_MASK 0x7 + +/* IOSF BT_MBI_UNIT_PMC regs */ +#define ISPSSPM0 0x39 +#define ISPSSPM0_ISPSSC_OFFSET 0 +#define ISPSSPM0_ISPSSC_MASK 0x00000003 +#define ISPSSPM0_ISPSSS_OFFSET 24 +#define ISPSSPM0_ISPSSS_MASK 0x03000000 +#define ISPSSPM0_IUNIT_POWER_ON 0x0 +#define ISPSSPM0_IUNIT_POWER_OFF 0x3 + +static int isp_set_power(struct pci_dev *dev, bool enable) +{ + unsigned long timeout; + u32 val = enable ? ISPSSPM0_IUNIT_POWER_ON : ISPSSPM0_IUNIT_POWER_OFF; + + /* Write to ISPSSPM0 bit[1:0] to power on/off the IUNIT */ + iosf_mbi_modify(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0, + val, ISPSSPM0_ISPSSC_MASK); + + /* + * There should be no IUNIT access while power-down is + * in progress. HW sighting: 4567865. + * Wait up to 50 ms for the IUNIT to shut down. + * And we do the same for power on. + */ + timeout = jiffies + msecs_to_jiffies(50); + do { + u32 tmp; + + /* Wait until ISPSSPM0 bit[25:24] shows the right value */ + iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0, &tmp); + tmp = (tmp & ISPSSPM0_ISPSSS_MASK) >> ISPSSPM0_ISPSSS_OFFSET; + if (tmp == val) + return 0; + + usleep_range(1000, 2000); + } while (time_before(jiffies, timeout)); + + dev_err(&dev->dev, "IUNIT power-%s timeout.\n", enable ? "on" : "off"); + return -EBUSY; +} + +static int isp_probe(struct pci_dev *dev, const struct pci_device_id *id) +{ + pm_runtime_allow(&dev->dev); + pm_runtime_put_sync_suspend(&dev->dev); + + return 0; +} + +static void isp_remove(struct pci_dev *dev) +{ + pm_runtime_get_sync(&dev->dev); + pm_runtime_forbid(&dev->dev); +} + +static int isp_pci_suspend(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); + u32 val; + + pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, 0); + + /* + * MRFLD IUNIT DPHY is located in an always-power-on island + * MRFLD HW design need all CSI ports are disabled before + * powering down the IUNIT. + */ + pci_read_config_dword(pdev, PCI_CSI_CONTROL, &val); + val |= PCI_CSI_CONTROL_PORTS_OFF_MASK; + pci_write_config_dword(pdev, PCI_CSI_CONTROL, val); + + /* + * We lose config space access when punit power gates + * the ISP. Can't use pci_set_power_state() because + * pmcsr won't actually change when we write to it. + */ + pci_save_state(pdev); + pdev->current_state = PCI_D3cold; + isp_set_power(pdev, false); + + return 0; +} + +static int isp_pci_resume(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); + + isp_set_power(pdev, true); + pdev->current_state = PCI_D0; + pci_restore_state(pdev); + + return 0; +} + +static UNIVERSAL_DEV_PM_OPS(isp_pm_ops, isp_pci_suspend, + isp_pci_resume, NULL); + +static const struct pci_device_id isp_id_table[] = { + { PCI_VDEVICE(INTEL, 0x0f38), }, + { PCI_VDEVICE(INTEL, 0x22b8), }, + { 0, } +}; +MODULE_DEVICE_TABLE(pci, isp_id_table); + +static struct pci_driver isp_pci_driver = { + .name = "intel_atomisp2_pm", + .id_table = isp_id_table, + .probe = isp_probe, + .remove = isp_remove, + .driver.pm = &isp_pm_ops, +}; + +module_pci_driver(isp_pci_driver); + +MODULE_DESCRIPTION("Intel AtomISP2 dummy / power-management drv (for suspend)"); +MODULE_AUTHOR("Hans de Goede "); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/platform/x86/intel_atomisp2_led.c b/drivers/platform/x86/intel_atomisp2_led.c deleted file mode 100644 index 5935dfca166f..000000000000 --- a/drivers/platform/x86/intel_atomisp2_led.c +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Driver for controlling LEDs for cameras connected to the Intel atomisp2 - * The main purpose of this driver is to turn off LEDs which are on at boot. - * - * Copyright (C) 2020 Hans de Goede - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* This must be leds-gpio as the leds-gpio driver binds to the name */ -#define DEV_NAME "leds-gpio" - -static const struct gpio_led atomisp2_leds[] = { - { - .name = "atomisp2::camera", - .default_state = LEDS_GPIO_DEFSTATE_OFF, - }, -}; - -static const struct gpio_led_platform_data atomisp2_leds_pdata = { - .num_leds = ARRAY_SIZE(atomisp2_leds), - .leds = atomisp2_leds, -}; - -static struct gpiod_lookup_table asus_t100ta_lookup = { - .dev_id = DEV_NAME, - .table = { - GPIO_LOOKUP_IDX("INT33FC:02", 8, NULL, 0, GPIO_ACTIVE_HIGH), - { } - } -}; - -static struct gpiod_lookup_table asus_t100chi_lookup = { - .dev_id = DEV_NAME, - .table = { - GPIO_LOOKUP_IDX("INT33FC:01", 24, NULL, 0, GPIO_ACTIVE_HIGH), - { } - } -}; - -static const struct dmi_system_id atomisp2_led_systems[] __initconst = { - { - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), - }, - .driver_data = &asus_t100ta_lookup, - }, - { - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"), - }, - .driver_data = &asus_t100ta_lookup, - }, - { - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100CHI"), - }, - .driver_data = &asus_t100chi_lookup, - }, - {} /* Terminating entry */ -}; -MODULE_DEVICE_TABLE(dmi, atomisp2_led_systems); - -static struct gpiod_lookup_table *gpio_lookup; -static struct platform_device *pdev; - -static int __init atomisp2_led_init(void) -{ - const struct dmi_system_id *system; - - system = dmi_first_match(atomisp2_led_systems); - if (!system) - return -ENODEV; - - gpio_lookup = system->driver_data; - gpiod_add_lookup_table(gpio_lookup); - - pdev = platform_device_register_resndata(NULL, - DEV_NAME, PLATFORM_DEVID_NONE, - NULL, 0, &atomisp2_leds_pdata, - sizeof(atomisp2_leds_pdata)); - if (IS_ERR(pdev)) - gpiod_remove_lookup_table(gpio_lookup); - - return PTR_ERR_OR_ZERO(pdev); -} - -static void __exit atomisp2_led_cleanup(void) -{ - platform_device_unregister(pdev); - gpiod_remove_lookup_table(gpio_lookup); -} - -module_init(atomisp2_led_init); -module_exit(atomisp2_led_cleanup); - -/* - * The ACPI INIT method from Asus WMI's code on the T100TA and T200TA turns the - * LED on (without the WMI interface allowing further control over the LED). - * Ensure we are loaded after asus-nb-wmi so that we turn the LED off again. - */ -MODULE_SOFTDEP("pre: asus_nb_wmi"); -MODULE_AUTHOR("Hans de Goede - * - * Based on various non upstream patches for ISP support: - * Copyright (C) 2010-2017 Intel Corporation. All rights reserved. - * Copyright (c) 2010 Silicon Hive www.siliconhive.com. - */ - -#include -#include -#include -#include -#include -#include - -/* PCI configuration regs */ -#define PCI_INTERRUPT_CTRL 0x9c - -#define PCI_CSI_CONTROL 0xe8 -#define PCI_CSI_CONTROL_PORTS_OFF_MASK 0x7 - -/* IOSF BT_MBI_UNIT_PMC regs */ -#define ISPSSPM0 0x39 -#define ISPSSPM0_ISPSSC_OFFSET 0 -#define ISPSSPM0_ISPSSC_MASK 0x00000003 -#define ISPSSPM0_ISPSSS_OFFSET 24 -#define ISPSSPM0_ISPSSS_MASK 0x03000000 -#define ISPSSPM0_IUNIT_POWER_ON 0x0 -#define ISPSSPM0_IUNIT_POWER_OFF 0x3 - -static int isp_set_power(struct pci_dev *dev, bool enable) -{ - unsigned long timeout; - u32 val = enable ? ISPSSPM0_IUNIT_POWER_ON : ISPSSPM0_IUNIT_POWER_OFF; - - /* Write to ISPSSPM0 bit[1:0] to power on/off the IUNIT */ - iosf_mbi_modify(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0, - val, ISPSSPM0_ISPSSC_MASK); - - /* - * There should be no IUNIT access while power-down is - * in progress. HW sighting: 4567865. - * Wait up to 50 ms for the IUNIT to shut down. - * And we do the same for power on. - */ - timeout = jiffies + msecs_to_jiffies(50); - do { - u32 tmp; - - /* Wait until ISPSSPM0 bit[25:24] shows the right value */ - iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, ISPSSPM0, &tmp); - tmp = (tmp & ISPSSPM0_ISPSSS_MASK) >> ISPSSPM0_ISPSSS_OFFSET; - if (tmp == val) - return 0; - - usleep_range(1000, 2000); - } while (time_before(jiffies, timeout)); - - dev_err(&dev->dev, "IUNIT power-%s timeout.\n", enable ? "on" : "off"); - return -EBUSY; -} - -static int isp_probe(struct pci_dev *dev, const struct pci_device_id *id) -{ - pm_runtime_allow(&dev->dev); - pm_runtime_put_sync_suspend(&dev->dev); - - return 0; -} - -static void isp_remove(struct pci_dev *dev) -{ - pm_runtime_get_sync(&dev->dev); - pm_runtime_forbid(&dev->dev); -} - -static int isp_pci_suspend(struct device *dev) -{ - struct pci_dev *pdev = to_pci_dev(dev); - u32 val; - - pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, 0); - - /* - * MRFLD IUNIT DPHY is located in an always-power-on island - * MRFLD HW design need all CSI ports are disabled before - * powering down the IUNIT. - */ - pci_read_config_dword(pdev, PCI_CSI_CONTROL, &val); - val |= PCI_CSI_CONTROL_PORTS_OFF_MASK; - pci_write_config_dword(pdev, PCI_CSI_CONTROL, val); - - /* - * We lose config space access when punit power gates - * the ISP. Can't use pci_set_power_state() because - * pmcsr won't actually change when we write to it. - */ - pci_save_state(pdev); - pdev->current_state = PCI_D3cold; - isp_set_power(pdev, false); - - return 0; -} - -static int isp_pci_resume(struct device *dev) -{ - struct pci_dev *pdev = to_pci_dev(dev); - - isp_set_power(pdev, true); - pdev->current_state = PCI_D0; - pci_restore_state(pdev); - - return 0; -} - -static UNIVERSAL_DEV_PM_OPS(isp_pm_ops, isp_pci_suspend, - isp_pci_resume, NULL); - -static const struct pci_device_id isp_id_table[] = { - { PCI_VDEVICE(INTEL, 0x0f38), }, - { PCI_VDEVICE(INTEL, 0x22b8), }, - { 0, } -}; -MODULE_DEVICE_TABLE(pci, isp_id_table); - -static struct pci_driver isp_pci_driver = { - .name = "intel_atomisp2_pm", - .id_table = isp_id_table, - .probe = isp_probe, - .remove = isp_remove, - .driver.pm = &isp_pm_ops, -}; - -module_pci_driver(isp_pci_driver); - -MODULE_DESCRIPTION("Intel AtomISP2 dummy / power-management drv (for suspend)"); -MODULE_AUTHOR("Hans de Goede "); -MODULE_LICENSE("GPL v2"); -- cgit