Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpio: elkhartlake: Convert to auxiliary driver

Since PCI device should not be abusing platform device, MFD parent to
platform child path is no longer being pursued for this driver. Convert
it to auxiliary driver, which will be used by EHL PSE auxiliary device.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20251112034040.457801-3-raag.jadav@intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Raag Jadav and committed by
Bartosz Golaszewski
10c15296 a0c83150

+20 -18
+1 -1
drivers/gpio/Kconfig
··· 1412 1412 1413 1413 config GPIO_ELKHARTLAKE 1414 1414 tristate "Intel Elkhart Lake PSE GPIO support" 1415 - depends on X86 || COMPILE_TEST 1415 + depends on INTEL_EHL_PSE_IO 1416 1416 select GPIO_TANGIER 1417 1417 help 1418 1418 Select this option to enable GPIO support for Intel Elkhart Lake
+19 -17
drivers/gpio/gpio-elkhartlake.c
··· 2 2 /* 3 3 * Intel Elkhart Lake PSE GPIO driver 4 4 * 5 - * Copyright (c) 2023 Intel Corporation. 5 + * Copyright (c) 2023, 2025 Intel Corporation. 6 6 * 7 7 * Authors: Pandith N <pandith.n@intel.com> 8 8 * Raag Jadav <raag.jadav@intel.com> 9 9 */ 10 10 11 + #include <linux/auxiliary_bus.h> 11 12 #include <linux/device.h> 12 13 #include <linux/err.h> 13 14 #include <linux/module.h> 14 - #include <linux/platform_device.h> 15 15 #include <linux/pm.h> 16 + 17 + #include <linux/ehl_pse_io_aux.h> 16 18 17 19 #include "gpio-tangier.h" 18 20 19 21 /* Each Intel EHL PSE GPIO Controller has 30 GPIO pins */ 20 22 #define EHL_PSE_NGPIO 30 21 23 22 - static int ehl_gpio_probe(struct platform_device *pdev) 24 + static int ehl_gpio_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id) 23 25 { 24 - struct device *dev = &pdev->dev; 26 + struct device *dev = &adev->dev; 27 + struct ehl_pse_io_data *data; 25 28 struct tng_gpio *priv; 26 - int irq, ret; 29 + int ret; 27 30 28 - irq = platform_get_irq(pdev, 0); 29 - if (irq < 0) 30 - return irq; 31 + data = dev_get_platdata(dev); 32 + if (!data) 33 + return -ENODATA; 31 34 32 35 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 33 36 if (!priv) 34 37 return -ENOMEM; 35 38 36 - priv->reg_base = devm_platform_ioremap_resource(pdev, 0); 39 + priv->reg_base = devm_ioremap_resource(dev, &data->mem); 37 40 if (IS_ERR(priv->reg_base)) 38 41 return PTR_ERR(priv->reg_base); 39 42 40 43 priv->dev = dev; 41 - priv->irq = irq; 44 + priv->irq = data->irq; 42 45 43 46 priv->info.base = -1; 44 47 priv->info.ngpio = EHL_PSE_NGPIO; ··· 54 51 if (ret) 55 52 return dev_err_probe(dev, ret, "tng_gpio_probe error\n"); 56 53 57 - platform_set_drvdata(pdev, priv); 54 + auxiliary_set_drvdata(adev, priv); 58 55 return 0; 59 56 } 60 57 61 - static const struct platform_device_id ehl_gpio_ids[] = { 62 - { "gpio-elkhartlake" }, 58 + static const struct auxiliary_device_id ehl_gpio_ids[] = { 59 + { EHL_PSE_IO_NAME "." EHL_PSE_GPIO_NAME }, 63 60 { } 64 61 }; 65 - MODULE_DEVICE_TABLE(platform, ehl_gpio_ids); 62 + MODULE_DEVICE_TABLE(auxiliary, ehl_gpio_ids); 66 63 67 - static struct platform_driver ehl_gpio_driver = { 64 + static struct auxiliary_driver ehl_gpio_driver = { 68 65 .driver = { 69 - .name = "gpio-elkhartlake", 70 66 .pm = pm_sleep_ptr(&tng_gpio_pm_ops), 71 67 }, 72 68 .probe = ehl_gpio_probe, 73 69 .id_table = ehl_gpio_ids, 74 70 }; 75 - module_platform_driver(ehl_gpio_driver); 71 + module_auxiliary_driver(ehl_gpio_driver); 76 72 77 73 MODULE_AUTHOR("Pandith N <pandith.n@intel.com>"); 78 74 MODULE_AUTHOR("Raag Jadav <raag.jadav@intel.com>");