linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: tc3589x: get rid of static base
@ 2014-10-28 10:06 Linus Walleij
  2014-11-03 17:58 ` Lee Jones
  2014-11-10 15:29 ` Lee Jones
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Walleij @ 2014-10-28 10:06 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel; +Cc: Linus Walleij

The TC3589x driver is now a device tree-only driver, so we want
only dynamic IRQs and GPIO numbers from the tc3589x, no static
assignments.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-tc3589x.c | 2 +-
 drivers/mfd/tc3589x.c       | 9 +++------
 include/linux/mfd/tc3589x.h | 8 --------
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index ae0f6466eb09..abdcf58935f5 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -262,7 +262,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	tc3589x_gpio->chip = template_chip;
 	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
 	tc3589x_gpio->chip.dev = &pdev->dev;
-	tc3589x_gpio->chip.base = (pdata) ? pdata->gpio_base : -1;
+	tc3589x_gpio->chip.base = -1;
 
 #ifdef CONFIG_OF_GPIO
 	tc3589x_gpio->chip.of_node = np;
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 0072e668c208..aacb3720065c 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -241,10 +241,8 @@ static struct irq_domain_ops tc3589x_irq_ops = {
 
 static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
 {
-	int base = tc3589x->irq_base;
-
 	tc3589x->domain = irq_domain_add_simple(
-		np, TC3589x_NR_INTERNAL_IRQS, base,
+		np, TC3589x_NR_INTERNAL_IRQS, 0,
 		&tc3589x_irq_ops, tc3589x);
 
 	if (!tc3589x->domain) {
@@ -298,7 +296,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
 	if (blocks & TC3589x_BLOCK_GPIO) {
 		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio,
 				      ARRAY_SIZE(tc3589x_dev_gpio), NULL,
-				      tc3589x->irq_base, tc3589x->domain);
+				      0, tc3589x->domain);
 		if (ret) {
 			dev_err(tc3589x->dev, "failed to add gpio child\n");
 			return ret;
@@ -309,7 +307,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
 	if (blocks & TC3589x_BLOCK_KEYPAD) {
 		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
 				      ARRAY_SIZE(tc3589x_dev_keypad), NULL,
-				      tc3589x->irq_base, tc3589x->domain);
+				      0, tc3589x->domain);
 		if (ret) {
 			dev_err(tc3589x->dev, "failed to keypad child\n");
 			return ret;
@@ -404,7 +402,6 @@ static int tc3589x_probe(struct i2c_client *i2c,
 	tc3589x->dev = &i2c->dev;
 	tc3589x->i2c = i2c;
 	tc3589x->pdata = pdata;
-	tc3589x->irq_base = pdata->irq_base;
 
 	switch (version) {
 	case TC3589X_TC35893:
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index e6088c2e2092..e1c12d84c26a 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data {
 
 /**
  * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
- * @gpio_base: first gpio number assigned to TC3589x.  A maximum of
- *	       %TC3589x_NR_GPIOS GPIOs will be allocated.
  * @setup: callback for board-specific initialization
  * @remove: callback for board-specific teardown
  */
 struct tc3589x_gpio_platform_data {
-	int gpio_base;
 	void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
 	void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
 };
@@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data {
 /**
  * struct tc3589x_platform_data - TC3589x platform data
  * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
- * @irq_base: base IRQ number.  %TC3589x_NR_IRQS irqs will be used.
  * @gpio: GPIO-specific platform data
  * @keypad: keypad-specific platform data
  */
 struct tc3589x_platform_data {
 	unsigned int block;
-	int irq_base;
 	struct tc3589x_gpio_platform_data *gpio;
 	const struct tc3589x_keypad_platform_data *keypad;
 };
 
-#define TC3589x_NR_GPIOS	24
-#define TC3589x_NR_IRQS		TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
-
 #endif
-- 
1.9.3


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

* Re: [PATCH] mfd: tc3589x: get rid of static base
  2014-10-28 10:06 [PATCH] mfd: tc3589x: get rid of static base Linus Walleij
@ 2014-11-03 17:58 ` Lee Jones
  2014-11-04 10:06   ` Linus Walleij
  2014-11-10 15:29 ` Lee Jones
  1 sibling, 1 reply; 4+ messages in thread
From: Lee Jones @ 2014-11-03 17:58 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Samuel Ortiz, linux-kernel

On Tue, 28 Oct 2014, Linus Walleij wrote:

> The TC3589x driver is now a device tree-only driver, so we want
> only dynamic IRQs and GPIO numbers from the tc3589x, no static
> assignments.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-tc3589x.c | 2 +-
>  drivers/mfd/tc3589x.c       | 9 +++------
>  include/linux/mfd/tc3589x.h | 8 --------
>  3 files changed, 4 insertions(+), 15 deletions(-)

Acked-by: Lee Jones <lee.jones@linaro.org>

How would you like me to handle this patch?

ib-mfd-gpio?

> diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
> index ae0f6466eb09..abdcf58935f5 100644
> --- a/drivers/gpio/gpio-tc3589x.c
> +++ b/drivers/gpio/gpio-tc3589x.c
> @@ -262,7 +262,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
>  	tc3589x_gpio->chip = template_chip;
>  	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
>  	tc3589x_gpio->chip.dev = &pdev->dev;
> -	tc3589x_gpio->chip.base = (pdata) ? pdata->gpio_base : -1;
> +	tc3589x_gpio->chip.base = -1;
>  
>  #ifdef CONFIG_OF_GPIO
>  	tc3589x_gpio->chip.of_node = np;
> diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
> index 0072e668c208..aacb3720065c 100644
> --- a/drivers/mfd/tc3589x.c
> +++ b/drivers/mfd/tc3589x.c
> @@ -241,10 +241,8 @@ static struct irq_domain_ops tc3589x_irq_ops = {
>  
>  static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
>  {
> -	int base = tc3589x->irq_base;
> -
>  	tc3589x->domain = irq_domain_add_simple(
> -		np, TC3589x_NR_INTERNAL_IRQS, base,
> +		np, TC3589x_NR_INTERNAL_IRQS, 0,
>  		&tc3589x_irq_ops, tc3589x);
>  
>  	if (!tc3589x->domain) {
> @@ -298,7 +296,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
>  	if (blocks & TC3589x_BLOCK_GPIO) {
>  		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio,
>  				      ARRAY_SIZE(tc3589x_dev_gpio), NULL,
> -				      tc3589x->irq_base, tc3589x->domain);
> +				      0, tc3589x->domain);
>  		if (ret) {
>  			dev_err(tc3589x->dev, "failed to add gpio child\n");
>  			return ret;
> @@ -309,7 +307,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
>  	if (blocks & TC3589x_BLOCK_KEYPAD) {
>  		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
>  				      ARRAY_SIZE(tc3589x_dev_keypad), NULL,
> -				      tc3589x->irq_base, tc3589x->domain);
> +				      0, tc3589x->domain);
>  		if (ret) {
>  			dev_err(tc3589x->dev, "failed to keypad child\n");
>  			return ret;
> @@ -404,7 +402,6 @@ static int tc3589x_probe(struct i2c_client *i2c,
>  	tc3589x->dev = &i2c->dev;
>  	tc3589x->i2c = i2c;
>  	tc3589x->pdata = pdata;
> -	tc3589x->irq_base = pdata->irq_base;
>  
>  	switch (version) {
>  	case TC3589X_TC35893:
> diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
> index e6088c2e2092..e1c12d84c26a 100644
> --- a/include/linux/mfd/tc3589x.h
> +++ b/include/linux/mfd/tc3589x.h
> @@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data {
>  
>  /**
>   * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
> - * @gpio_base: first gpio number assigned to TC3589x.  A maximum of
> - *	       %TC3589x_NR_GPIOS GPIOs will be allocated.
>   * @setup: callback for board-specific initialization
>   * @remove: callback for board-specific teardown
>   */
>  struct tc3589x_gpio_platform_data {
> -	int gpio_base;
>  	void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
>  	void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
>  };
> @@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data {
>  /**
>   * struct tc3589x_platform_data - TC3589x platform data
>   * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
> - * @irq_base: base IRQ number.  %TC3589x_NR_IRQS irqs will be used.
>   * @gpio: GPIO-specific platform data
>   * @keypad: keypad-specific platform data
>   */
>  struct tc3589x_platform_data {
>  	unsigned int block;
> -	int irq_base;
>  	struct tc3589x_gpio_platform_data *gpio;
>  	const struct tc3589x_keypad_platform_data *keypad;
>  };
>  
> -#define TC3589x_NR_GPIOS	24
> -#define TC3589x_NR_IRQS		TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
> -
>  #endif

-- 
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] 4+ messages in thread

* Re: [PATCH] mfd: tc3589x: get rid of static base
  2014-11-03 17:58 ` Lee Jones
@ 2014-11-04 10:06   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-11-04 10:06 UTC (permalink / raw)
  To: Lee Jones; +Cc: Samuel Ortiz, linux-kernel

On Mon, Nov 3, 2014 at 6:58 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 28 Oct 2014, Linus Walleij wrote:
>
>> The TC3589x driver is now a device tree-only driver, so we want
>> only dynamic IRQs and GPIO numbers from the tc3589x, no static
>> assignments.
>>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>  drivers/gpio/gpio-tc3589x.c | 2 +-
>>  drivers/mfd/tc3589x.c       | 9 +++------
>>  include/linux/mfd/tc3589x.h | 8 --------
>>  3 files changed, 4 insertions(+), 15 deletions(-)
>
> Acked-by: Lee Jones <lee.jones@linaro.org>
>
> How would you like me to handle this patch?
>
> ib-mfd-gpio?

Nah just merge it into MFD and let's hope nothing clashes.
I have no dependent patches for this cycle AFAIK.

Yours,
Linus Walleij

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

* Re: [PATCH] mfd: tc3589x: get rid of static base
  2014-10-28 10:06 [PATCH] mfd: tc3589x: get rid of static base Linus Walleij
  2014-11-03 17:58 ` Lee Jones
@ 2014-11-10 15:29 ` Lee Jones
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2014-11-10 15:29 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Samuel Ortiz, linux-kernel

On Tue, 28 Oct 2014, Linus Walleij wrote:

> The TC3589x driver is now a device tree-only driver, so we want
> only dynamic IRQs and GPIO numbers from the tc3589x, no static
> assignments.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-tc3589x.c | 2 +-
>  drivers/mfd/tc3589x.c       | 9 +++------
>  include/linux/mfd/tc3589x.h | 8 --------
>  3 files changed, 4 insertions(+), 15 deletions(-)

Applied, thanks.

> diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
> index ae0f6466eb09..abdcf58935f5 100644
> --- a/drivers/gpio/gpio-tc3589x.c
> +++ b/drivers/gpio/gpio-tc3589x.c
> @@ -262,7 +262,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
>  	tc3589x_gpio->chip = template_chip;
>  	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
>  	tc3589x_gpio->chip.dev = &pdev->dev;
> -	tc3589x_gpio->chip.base = (pdata) ? pdata->gpio_base : -1;
> +	tc3589x_gpio->chip.base = -1;
>  
>  #ifdef CONFIG_OF_GPIO
>  	tc3589x_gpio->chip.of_node = np;
> diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
> index 0072e668c208..aacb3720065c 100644
> --- a/drivers/mfd/tc3589x.c
> +++ b/drivers/mfd/tc3589x.c
> @@ -241,10 +241,8 @@ static struct irq_domain_ops tc3589x_irq_ops = {
>  
>  static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
>  {
> -	int base = tc3589x->irq_base;
> -
>  	tc3589x->domain = irq_domain_add_simple(
> -		np, TC3589x_NR_INTERNAL_IRQS, base,
> +		np, TC3589x_NR_INTERNAL_IRQS, 0,
>  		&tc3589x_irq_ops, tc3589x);
>  
>  	if (!tc3589x->domain) {
> @@ -298,7 +296,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
>  	if (blocks & TC3589x_BLOCK_GPIO) {
>  		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio,
>  				      ARRAY_SIZE(tc3589x_dev_gpio), NULL,
> -				      tc3589x->irq_base, tc3589x->domain);
> +				      0, tc3589x->domain);
>  		if (ret) {
>  			dev_err(tc3589x->dev, "failed to add gpio child\n");
>  			return ret;
> @@ -309,7 +307,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
>  	if (blocks & TC3589x_BLOCK_KEYPAD) {
>  		ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
>  				      ARRAY_SIZE(tc3589x_dev_keypad), NULL,
> -				      tc3589x->irq_base, tc3589x->domain);
> +				      0, tc3589x->domain);
>  		if (ret) {
>  			dev_err(tc3589x->dev, "failed to keypad child\n");
>  			return ret;
> @@ -404,7 +402,6 @@ static int tc3589x_probe(struct i2c_client *i2c,
>  	tc3589x->dev = &i2c->dev;
>  	tc3589x->i2c = i2c;
>  	tc3589x->pdata = pdata;
> -	tc3589x->irq_base = pdata->irq_base;
>  
>  	switch (version) {
>  	case TC3589X_TC35893:
> diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
> index e6088c2e2092..e1c12d84c26a 100644
> --- a/include/linux/mfd/tc3589x.h
> +++ b/include/linux/mfd/tc3589x.h
> @@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data {
>  
>  /**
>   * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
> - * @gpio_base: first gpio number assigned to TC3589x.  A maximum of
> - *	       %TC3589x_NR_GPIOS GPIOs will be allocated.
>   * @setup: callback for board-specific initialization
>   * @remove: callback for board-specific teardown
>   */
>  struct tc3589x_gpio_platform_data {
> -	int gpio_base;
>  	void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
>  	void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
>  };
> @@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data {
>  /**
>   * struct tc3589x_platform_data - TC3589x platform data
>   * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
> - * @irq_base: base IRQ number.  %TC3589x_NR_IRQS irqs will be used.
>   * @gpio: GPIO-specific platform data
>   * @keypad: keypad-specific platform data
>   */
>  struct tc3589x_platform_data {
>  	unsigned int block;
> -	int irq_base;
>  	struct tc3589x_gpio_platform_data *gpio;
>  	const struct tc3589x_keypad_platform_data *keypad;
>  };
>  
> -#define TC3589x_NR_GPIOS	24
> -#define TC3589x_NR_IRQS		TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
> -
>  #endif

-- 
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] 4+ messages in thread

end of thread, other threads:[~2014-11-10 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 10:06 [PATCH] mfd: tc3589x: get rid of static base Linus Walleij
2014-11-03 17:58 ` Lee Jones
2014-11-04 10:06   ` Linus Walleij
2014-11-10 15:29 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).