Inter-revision diff: patch 3

Comparing v6 (message) to v2 (message)

--- v6
+++ v2
@@ -1,18 +1,18 @@
-As preparation for the extension of support for all three mc13xxx
-variants, convert the members of mc13xxx_buttons_platform_data to
-arrays to allow index access within the next commit.
+As preparation for mc13783-pwrbutton OF support, convert the members of
+mc13xxx_buttons_platform_data to arrays to allow index access within
+the next commit.
 
 Signed-off-by: Alexander Kurz <akurz@blala.de>
 ---
- drivers/input/misc/mc13783-pwrbutton.c | 42 +++++++++++++-------------
- include/linux/mfd/mc13xxx.h            |  8 ++---
- 2 files changed, 23 insertions(+), 27 deletions(-)
+ drivers/input/misc/mc13783-pwrbutton.c | 54 +++++++++++++-------------
+ include/linux/mfd/mc13xxx.h            |  8 +---
+ 2 files changed, 29 insertions(+), 33 deletions(-)
 
 diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c
-index 20f68aab6edf..2ee115d77b1c 100644
+index 9fd84b8d163d..ace9f286fd24 100644
 --- a/drivers/input/misc/mc13783-pwrbutton.c
 +++ b/drivers/input/misc/mc13783-pwrbutton.c
-@@ -108,24 +108,24 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
+@@ -127,24 +127,24 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
  	if (!priv)
  		return -ENOMEM;
  
@@ -45,9 +45,9 @@
 +		if (pdata->b_on_flags[0] & MC13783_BUTTON_RESET_EN)
  			reg |= MC13783_POWER_CONTROL_2_ON1BRSTEN;
  
- 		irq = platform_get_irq_byname(pdev, "b1on");
-@@ -144,15 +144,15 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
- 		priv->irq[0] = irq;
+ 		err = mc13xxx_irq_request(mc13783, MC13783_IRQ_ONOFD1,
+@@ -155,15 +155,15 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
+ 		}
  	}
  
 -	if (pdata->b2on_flags & MC13783_BUTTON_ENABLE) {
@@ -67,9 +67,9 @@
 +		if (pdata->b_on_flags[1] & MC13783_BUTTON_RESET_EN)
  			reg |= MC13783_POWER_CONTROL_2_ON2BRSTEN;
  
- 		irq = platform_get_irq_byname(pdev, "b2on");
-@@ -171,15 +171,15 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
- 		priv->irq[1] = irq;
+ 		err = mc13xxx_irq_request(mc13783, MC13783_IRQ_ONOFD2,
+@@ -174,15 +174,15 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
+ 		}
  	}
  
 -	if (pdata->b3on_flags & MC13783_BUTTON_ENABLE) {
@@ -89,12 +89,46 @@
 +		if (pdata->b_on_flags[2] & MC13783_BUTTON_RESET_EN)
  			reg |= MC13783_POWER_CONTROL_2_ON3BRSTEN;
  
- 		irq = platform_get_irq_byname(pdev, "b3on");
+ 		err = mc13xxx_irq_request(mc13783, MC13783_IRQ_ONOFD3,
+@@ -218,15 +218,15 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
+ free_irq:
+ 	mc13xxx_lock(mc13783);
+ 
+-	if (pdata->b3on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[2] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(mc13783, MC13783_IRQ_ONOFD3, priv);
+ 
+ free_irq_b2:
+-	if (pdata->b2on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[1] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(mc13783, MC13783_IRQ_ONOFD2, priv);
+ 
+ free_irq_b1:
+-	if (pdata->b1on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[0] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(mc13783, MC13783_IRQ_ONOFD1, priv);
+ 
+ free_mc13xxx_lock:
+@@ -244,11 +244,11 @@ static void mc13783_pwrbutton_remove(struct platform_device *pdev)
+ 
+ 	mc13xxx_lock(priv->mc13783);
+ 
+-	if (pdata->b3on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[2] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD3, priv);
+-	if (pdata->b2on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[1] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD2, priv);
+-	if (pdata->b1on_flags & MC13783_BUTTON_ENABLE)
++	if (pdata->b_on_flags[0] & MC13783_BUTTON_ENABLE)
+ 		mc13xxx_irq_free(priv->mc13783, MC13783_IRQ_ONOFD1, priv);
+ 
+ 	mc13xxx_unlock(priv->mc13783);
 diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
-index dd46fe424a80..4437ab80fcf8 100644
+index f372926d5894..0393083af28a 100644
 --- a/include/linux/mfd/mc13xxx.h
 +++ b/include/linux/mfd/mc13xxx.h
-@@ -181,12 +181,8 @@ struct mc13xxx_leds_platform_data {
+@@ -187,12 +187,8 @@ struct mc13xxx_leds_platform_data {
  #define MC13783_BUTTON_RESET_EN		(1 << 4)
  
  struct mc13xxx_buttons_platform_data {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help