All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mfd: intel_soc_pmic_core: Remove unnecessary function
@ 2017-02-21 11:09 Andy Shevchenko
  2017-03-14 14:44 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-02-21 11:09 UTC (permalink / raw)
  To: Lee Jones, linux-kernel; +Cc: Andy Shevchenko

Since commit 845c877009cf ("i2c / ACPI: Assign IRQ for devices that have
GpioInt automatically") I2C core assigns interrupt line to I2C slave
devices with regarding to GpioInt() resources.

There is no need to repeat this in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
- remove unused variable
 drivers/mfd/intel_soc_pmic_core.c | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
index 12d6ebb4ae5d..3b5583586662 100644
--- a/drivers/mfd/intel_soc_pmic_core.c
+++ b/drivers/mfd/intel_soc_pmic_core.c
@@ -44,22 +44,6 @@ static struct pwm_lookup crc_pwm_lookup[] = {
 	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
 };
 
-static int intel_soc_pmic_find_gpio_irq(struct device *dev)
-{
-	struct gpio_desc *desc;
-	int irq;
-
-	desc = devm_gpiod_get_index(dev, "intel_soc_pmic", 0, GPIOD_IN);
-	if (IS_ERR(desc))
-		return PTR_ERR(desc);
-
-	irq = gpiod_to_irq(desc);
-	if (irq < 0)
-		dev_warn(dev, "Can't get irq: %d\n", irq);
-
-	return irq;
-}
-
 static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 				    const struct i2c_device_id *i2c_id)
 {
@@ -68,7 +52,6 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	struct intel_soc_pmic_config *config;
 	struct intel_soc_pmic *pmic;
 	int ret;
-	int irq;
 
 	id = acpi_match_device(dev->driver->acpi_match_table, dev);
 	if (!id || !id->driver_data)
@@ -83,14 +66,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	dev_set_drvdata(dev, pmic);
 
 	pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config);
-
-	/*
-	 * On some boards the PMIC interrupt may come from a GPIO line. Try to
-	 * lookup the ACPI table for a such connection and setup a GPIO
-	 * interrupt if it exists. Otherwise use the IRQ provided by I2C
-	 */
-	irq = intel_soc_pmic_find_gpio_irq(dev);
-	pmic->irq = (irq < 0) ? i2c->irq : irq;
+	pmic->irq = i2c->irq;
 
 	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
 				  config->irq_flags | IRQF_ONESHOT,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mfd: intel_soc_pmic_core: Remove unnecessary function
  2017-02-21 11:09 [PATCH v2] mfd: intel_soc_pmic_core: Remove unnecessary function Andy Shevchenko
@ 2017-03-14 14:44 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2017-03-14 14:44 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel

On Tue, 21 Feb 2017, Andy Shevchenko wrote:

> Since commit 845c877009cf ("i2c / ACPI: Assign IRQ for devices that have
> GpioInt automatically") I2C core assigns interrupt line to I2C slave
> devices with regarding to GpioInt() resources.
> 
> There is no need to repeat this in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> - remove unused variable
>  drivers/mfd/intel_soc_pmic_core.c | 26 +-------------------------
>  1 file changed, 1 insertion(+), 25 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
> index 12d6ebb4ae5d..3b5583586662 100644
> --- a/drivers/mfd/intel_soc_pmic_core.c
> +++ b/drivers/mfd/intel_soc_pmic_core.c
> @@ -44,22 +44,6 @@ static struct pwm_lookup crc_pwm_lookup[] = {
>  	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
>  };
>  
> -static int intel_soc_pmic_find_gpio_irq(struct device *dev)
> -{
> -	struct gpio_desc *desc;
> -	int irq;
> -
> -	desc = devm_gpiod_get_index(dev, "intel_soc_pmic", 0, GPIOD_IN);
> -	if (IS_ERR(desc))
> -		return PTR_ERR(desc);
> -
> -	irq = gpiod_to_irq(desc);
> -	if (irq < 0)
> -		dev_warn(dev, "Can't get irq: %d\n", irq);
> -
> -	return irq;
> -}
> -
>  static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
>  				    const struct i2c_device_id *i2c_id)
>  {
> @@ -68,7 +52,6 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
>  	struct intel_soc_pmic_config *config;
>  	struct intel_soc_pmic *pmic;
>  	int ret;
> -	int irq;
>  
>  	id = acpi_match_device(dev->driver->acpi_match_table, dev);
>  	if (!id || !id->driver_data)
> @@ -83,14 +66,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
>  	dev_set_drvdata(dev, pmic);
>  
>  	pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config);
> -
> -	/*
> -	 * On some boards the PMIC interrupt may come from a GPIO line. Try to
> -	 * lookup the ACPI table for a such connection and setup a GPIO
> -	 * interrupt if it exists. Otherwise use the IRQ provided by I2C
> -	 */
> -	irq = intel_soc_pmic_find_gpio_irq(dev);
> -	pmic->irq = (irq < 0) ? i2c->irq : irq;
> +	pmic->irq = i2c->irq;
>  
>  	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
>  				  config->irq_flags | IRQF_ONESHOT,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-14 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 11:09 [PATCH v2] mfd: intel_soc_pmic_core: Remove unnecessary function Andy Shevchenko
2017-03-14 14:44 ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.