lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6aa3721-0425-49e7-e5dd-8fdc8e7cb1d5@linux.intel.com>
Date: Wed, 19 Nov 2025 13:42:02 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
cc: Hans de Goede <hansg@...nel.org>, 
    Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
    linus.walleij@...aro.org, brgl@...ev.pl, 
    platform-driver-x86@...r.kernel.org, linux-gpio@...r.kernel.org, 
    LKML <linux-kernel@...r.kernel.org>, 
    Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v3 2/2] gpio: elkhartlake: Convert to auxiliary driver

On Wed, 12 Nov 2025, Raag Jadav wrote:

> 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@...el.com>
> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/gpio/Kconfig            |  2 +-
>  drivers/gpio/gpio-elkhartlake.c | 36 +++++++++++++++++----------------
>  2 files changed, 20 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 7ee3afbc2b05..d4b4451b4696 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -1413,7 +1413,7 @@ config HTC_EGPIO
>  
>  config GPIO_ELKHARTLAKE
>  	tristate "Intel Elkhart Lake PSE GPIO support"
> -	depends on X86 || COMPILE_TEST
> +	depends on INTEL_EHL_PSE_IO
>  	select GPIO_TANGIER
>  	help
>  	  Select this option to enable GPIO support for Intel Elkhart Lake
> diff --git a/drivers/gpio/gpio-elkhartlake.c b/drivers/gpio/gpio-elkhartlake.c
> index 95de52d2cc63..b96e7928b6e5 100644
> --- a/drivers/gpio/gpio-elkhartlake.c
> +++ b/drivers/gpio/gpio-elkhartlake.c
> @@ -2,43 +2,46 @@
>  /*
>   * Intel Elkhart Lake PSE GPIO driver
>   *
> - * Copyright (c) 2023 Intel Corporation.
> + * Copyright (c) 2023, 2025 Intel Corporation.
>   *
>   * Authors: Pandith N <pandith.n@...el.com>
>   *          Raag Jadav <raag.jadav@...el.com>
>   */
>  
> +#include <linux/auxiliary_bus.h>
>  #include <linux/device.h>
>  #include <linux/err.h>
>  #include <linux/module.h>
> -#include <linux/platform_device.h>
>  #include <linux/pm.h>
>  
> +#include <linux/ehl_pse_io_aux.h>
> +
>  #include "gpio-tangier.h"
>  
>  /* Each Intel EHL PSE GPIO Controller has 30 GPIO pins */
>  #define EHL_PSE_NGPIO		30
>  
> -static int ehl_gpio_probe(struct platform_device *pdev)
> +static int ehl_gpio_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id)
>  {
> -	struct device *dev = &pdev->dev;
> +	struct device *dev = &adev->dev;
> +	struct ehl_pse_io_data *data;
>  	struct tng_gpio *priv;
> -	int irq, ret;
> +	int ret;
>  
> -	irq = platform_get_irq(pdev, 0);
> -	if (irq < 0)
> -		return irq;
> +	data = dev_get_platdata(dev);
> +	if (!data)
> +		return -ENODATA;
>  
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	priv->reg_base = devm_platform_ioremap_resource(pdev, 0);
> +	priv->reg_base = devm_ioremap_resource(dev, &data->mem);
>  	if (IS_ERR(priv->reg_base))
>  		return PTR_ERR(priv->reg_base);
>  
>  	priv->dev = dev;
> -	priv->irq = irq;
> +	priv->irq = data->irq;
>  
>  	priv->info.base = -1;
>  	priv->info.ngpio = EHL_PSE_NGPIO;
> @@ -51,25 +54,24 @@ static int ehl_gpio_probe(struct platform_device *pdev)
>  	if (ret)
>  		return dev_err_probe(dev, ret, "tng_gpio_probe error\n");
>  
> -	platform_set_drvdata(pdev, priv);
> +	auxiliary_set_drvdata(adev, priv);
>  	return 0;
>  }
>  
> -static const struct platform_device_id ehl_gpio_ids[] = {
> -	{ "gpio-elkhartlake" },
> +static const struct auxiliary_device_id ehl_gpio_ids[] = {
> +	{ EHL_PSE_IO_NAME "." EHL_PSE_GPIO_NAME },
>  	{ }
>  };
> -MODULE_DEVICE_TABLE(platform, ehl_gpio_ids);
> +MODULE_DEVICE_TABLE(auxiliary, ehl_gpio_ids);
>  
> -static struct platform_driver ehl_gpio_driver = {
> +static struct auxiliary_driver ehl_gpio_driver = {
>  	.driver	= {
> -		.name	= "gpio-elkhartlake",
>  		.pm	= pm_sleep_ptr(&tng_gpio_pm_ops),
>  	},
>  	.probe		= ehl_gpio_probe,
>  	.id_table	= ehl_gpio_ids,
>  };
> -module_platform_driver(ehl_gpio_driver);
> +module_auxiliary_driver(ehl_gpio_driver);
>  
>  MODULE_AUTHOR("Pandith N <pandith.n@...el.com>");
>  MODULE_AUTHOR("Raag Jadav <raag.jadav@...el.com>");
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ