Skip to contentSkip to conversation

mc13783: add pwr button support

PATCH Superseded Philippe Rétornaz 5 participants 15 messages Jul 22, 2011 – Aug 25, 2011

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v6 cover mc13783: add pwr button support

Hello

This add button handling for the MC13783 PMIC.

Patch 1 & 2 modify the mc13xxx MFD driver to use the platform data to resgister the led subdevice and unconditionally register the regulator subdevice (as suggested by Mark and Uwe).

Patch 3 remove the use of the *_USE_REGULATOR and *_USE_LED macros in the platform files.

Patch 4 must be applied after patch 1,2,3 to remove the obsolete define.

Patch 5 modify the mc13xxx MFD driver to add a button subdevice and also adds the mc13783-pwrbutton driver using a misc input device.

The last patch adds the power on button support to the mx31moboard boards.

v2: first patch modified according to comments by Dmitry Torokhov
v3: Implement review by Uwe
v4: Implement comments by Uwe and Mark
v5: Reorder patchset
v6: Minor corrections

Philippe R?tornaz (6):
mc13xxx: Unconditionally register regulator subdevice
mc13xxx: implicitly register led subdevice
mc13xxx: remove obsolete leds and regulators flags
mc13xxx: remove unused define
mc13783: add power button support
mx31moboard: Add MC13783 power button support

 arch/arm/mach-imx/mach-mx27_3ds.c      |    1 -
 arch/arm/mach-imx/mach-mx31_3ds.c      |    2 +-
 arch/arm/mach-imx/mach-mx31lite.c      |    3 +-
 arch/arm/mach-imx/mach-mx31moboard.c   |   11 +-
 arch/arm/mach-imx/mach-pcm038.c        |    3 +-
 arch/arm/mach-mx5/mx51_efika.c         |    2 +-
 drivers/input/misc/Kconfig             |   10 +
 drivers/input/misc/Makefile            |    1 +
 drivers/input/misc/mc13783-pwrbutton.c |  282 ++++++++++++++++++++++++++++++++
 drivers/mfd/mc13xxx-core.c             |   17 ++-
 include/linux/mfd/mc13783.h            |    3 +-
 include/linux/mfd/mc13xxx.h            |   19 ++-
 12 files changed, 336 insertions(+), 18 deletions(-)
 create mode 100644 drivers/input/misc/mc13783-pwrbutton.c
#1 lore raw

PATCH v6 1/6 mc13xxx: Unconditionally register regulator subdevice

---
 drivers/mfd/mc13xxx-core.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/mc13xxx-core.c +2 -4
index 7e4d44b..c238f6b 100644
@@ -763,10 +763,8 @@ err_revision:
 	if (pdata->flags & MC13XXX_USE_CODEC)
 		mc13xxx_add_subdevice(mc13xxx, "%s-codec");
 
-	if (pdata->flags & MC13XXX_USE_REGULATOR) {
-		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
-				&pdata->regulators, sizeof(pdata->regulators));
-	}
+	mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
+		&pdata->regulators, sizeof(pdata->regulators));
 
 	if (pdata->flags & MC13XXX_USE_RTC)
 		mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH v6 2/6 mc13xxx: implicitly register led subdevice

---
 drivers/mfd/mc13xxx-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/mc13xxx-core.c +1 -1
index c238f6b..2867c21 100644
@@ -772,7 +772,7 @@ err_revision:
 	if (pdata->flags & MC13XXX_USE_TOUCHSCREEN)
 		mc13xxx_add_subdevice(mc13xxx, "%s-ts");
 
-	if (pdata->flags & MC13XXX_USE_LED)
+	if (pdata->leds)
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
 				pdata->leds, sizeof(*pdata->leds));
 
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH v6 3/6 mc13xxx: remove obsolete leds and regulators flags

---
 arch/arm/mach-imx/mach-mx27_3ds.c    |    1 -
 arch/arm/mach-imx/mach-mx31_3ds.c    |    2 +-
 arch/arm/mach-imx/mach-mx31lite.c    |    3 +--
 arch/arm/mach-imx/mach-mx31moboard.c |    3 +--
 arch/arm/mach-imx/mach-pcm038.c      |    3 +--
 arch/arm/mach-mx5/mx51_efika.c       |    2 +-
 6 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/mach-imx/mach-mx27_3ds.c +0 -1
index 6e1accf..8cd507d 100644
@@ -238,7 +238,6 @@ static struct mc13xxx_platform_data mc13783_pdata = {
 		.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
 
 	},
-	.flags  = MC13783_USE_REGULATOR,
 };
 
 /* SPI */
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
index 9b98244..7978f58 100644
@@ -496,7 +496,7 @@ static struct mc13xxx_platform_data mc13783_pdata = {
 		.regulators = mx31_3ds_regulators,
 		.num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
 	},
-	.flags  = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
+	.flags  = MC13783_USE_TOUCHSCREEN,
 };
 
 /* SPI */
arch/arm/mach-imx/mach-mx31lite.c +1 -2
index ac9b4ca..ae99cae 100644
@@ -112,8 +112,7 @@ static const struct spi_imx_master spi1_pdata __initconst = {
 };
 
 static struct mc13xxx_platform_data mc13783_pdata __initdata = {
-	.flags  = MC13XXX_USE_RTC |
-		  MC13XXX_USE_REGULATOR,
+	.flags  = MC13XXX_USE_RTC,
 };
 
 static struct spi_board_info mc13783_spi_dev __initdata = {
arch/arm/mach-imx/mach-mx31moboard.c +1 -2
index 12ee755..579ca1f 100644
@@ -270,8 +270,7 @@ static struct mc13xxx_platform_data moboard_pmic = {
 		.num_regulators = ARRAY_SIZE(moboard_regulators),
 	},
 	.leds = &moboard_leds,
-	.flags = MC13XXX_USE_REGULATOR | MC13XXX_USE_RTC |
-		MC13XXX_USE_ADC | MC13XXX_USE_LED,
+	.flags = MC13XXX_USE_RTC | MC13XXX_USE_ADC,
 };
 
 static struct spi_board_info moboard_spi_board_info[] __initdata = {
arch/arm/mach-imx/mach-pcm038.c +1 -2
index 853bb87..70aaa7d 100644
@@ -266,8 +266,7 @@ static struct mc13xxx_platform_data pcm038_pmic = {
 		.regulators = pcm038_regulators,
 		.num_regulators = ARRAY_SIZE(pcm038_regulators),
 	},
-	.flags = MC13783_USE_ADC | MC13783_USE_REGULATOR |
-		 MC13783_USE_TOUCHSCREEN,
+	.flags = MC13783_USE_ADC | MC13783_USE_TOUCHSCREEN,
 };
 
 static struct spi_board_info pcm038_spi_board_info[] __initdata = {
arch/arm/mach-mx5/mx51_efika.c +1 -1
index 1105ef3..e2e4096 100644
@@ -567,7 +567,7 @@ static struct mc13xxx_regulator_init_data mx51_efika_regulators[] = {
 };
 
 static struct mc13xxx_platform_data mx51_efika_mc13892_data = {
-	.flags = MC13XXX_USE_RTC | MC13XXX_USE_REGULATOR,
+	.flags = MC13XXX_USE_RTC,
 	.regulators = {
 		.num_regulators = ARRAY_SIZE(mx51_efika_regulators),
 		.regulators = mx51_efika_regulators,
Signature · 1 line
1.6.3.3
#4 lore raw

PATCH v6 4/6 mc13xxx: remove unused define

---
 include/linux/mfd/mc13783.h |    2 --
 include/linux/mfd/mc13xxx.h |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)
include/linux/mfd/mc13783.h +0 -2
index 7d0f3d6..3756a30 100644
@@ -112,8 +112,6 @@ static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
 #define MC13783_USE_CODEC	MC13XXX_USE_CODEC
 #define MC13783_USE_ADC		MC13XXX_USE_ADC
 #define MC13783_USE_RTC		MC13XXX_USE_RTC
-#define MC13783_USE_REGULATOR	MC13XXX_USE_REGULATOR
-#define MC13783_USE_LED		MC13XXX_USE_LED
 
 #define MC13783_ADC_MODE_TS		1
 #define MC13783_ADC_MODE_SINGLE_CHAN	2
include/linux/mfd/mc13xxx.h +0 -2
index c064bea..cef1497 100644
@@ -142,8 +142,6 @@ struct mc13xxx_platform_data {
 #define MC13XXX_USE_CODEC	(1 << 1)
 #define MC13XXX_USE_ADC		(1 << 2)
 #define MC13XXX_USE_RTC		(1 << 3)
-#define MC13XXX_USE_REGULATOR	(1 << 4)
-#define MC13XXX_USE_LED		(1 << 5)
 	unsigned int flags;
 
 	struct mc13xxx_regulator_platform_data regulators;
Signature · 1 line
1.6.3.3
#5 lore raw

PATCH v6 5/6 mc13783: add power button support

This adds support for the power-on buttons of MC13783 PMIC. This is done using a misc input device.

---
 drivers/input/misc/Kconfig             |   10 +
 drivers/input/misc/Makefile            |    1 +
 drivers/input/misc/mc13783-pwrbutton.c |  282 ++++++++++++++++++++++++++++++++
 drivers/mfd/mc13xxx-core.c             |    9 +
 include/linux/mfd/mc13783.h            |    1 +
 include/linux/mfd/mc13xxx.h            |   17 ++
 6 files changed, 320 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/mc13783-pwrbutton.c
drivers/input/misc/Kconfig +10 -0
index 45dc6aa..4272658 100644
@@ -100,6 +100,16 @@ config INPUT_MAX8925_ONKEY
 	  To compile this driver as a module, choose M here: the module
 	  will be called max8925_onkey.
 
+config INPUT_MC13783_PWRBUTTON
+	tristate "MC13783 ON buttons"
+	depends on MFD_MC13783
+	help
+	  Support the ON buttons of MC13783 PMIC as an input device
+	  reporting power button status.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called mc13783-pwrbutton.
+
 config INPUT_APANEL
 	tristate "Fujitsu Lifebook Application Panel buttons"
 	depends on X86 && I2C && LEDS_CLASS
drivers/input/misc/Makefile +1 -0
index 38efb2c..ecced4c 100644
@@ -27,6 +27,7 @@ obj-$(CONFIG_INPUT_IXP4XX_BEEPER)	+= ixp4xx-beeper.o
 obj-$(CONFIG_INPUT_KEYSPAN_REMOTE)	+= keyspan_remote.o
 obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
 obj-$(CONFIG_INPUT_MAX8925_ONKEY)	+= max8925_onkey.o
+obj-$(CONFIG_INPUT_MC13783_PWRBUTTON)	+= mc13783-pwrbutton.o
 obj-$(CONFIG_INPUT_PCAP)		+= pcap_keys.o
 obj-$(CONFIG_INPUT_PCF50633_PMU)	+= pcf50633-input.o
 obj-$(CONFIG_INPUT_PCF8574)		+= pcf8574_keypad.o
drivers/input/misc/mc13783-pwrbutton.c new file +282 -0

282 lines not on this page · raw message

drivers/mfd/mc13xxx-core.c +9 -0
index 2867c21..ce4377f 100644
@@ -716,6 +716,11 @@ static int mc13xxx_probe(struct spi_device *spi)
 	enum mc13xxx_id id;
 	int ret;
 
+	if (!pdata) {
+		dev_err(&spi->dev, "invalid platform data\n");
+		return -EINVAL;
+	}
+
 	mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
 	if (!mc13xxx)
 		return -ENOMEM;
@@ -776,6 +781,10 @@ err_revision:
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
 				pdata->leds, sizeof(*pdata->leds));
 
+	if (pdata->buttons)
+		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-pwrbutton",
+				pdata->buttons, sizeof(*pdata->buttons));
+
 	return 0;
 }
 
include/linux/mfd/mc13783.h +1 -0
index 3756a30..aa824d0 100644
@@ -106,6 +106,7 @@ static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
 #define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
 #define mc13783_led_platform_data mc13xxx_led_platform_data
 #define mc13783_leds_platform_data mc13xxx_leds_platform_data
+#define mc13783_buttons_platform_data mc13xxx_buttons_platform_data
 
 #define mc13783_platform_data mc13xxx_platform_data
 #define MC13783_USE_TOUCHSCREEN	MC13XXX_USE_TOUCHSCREEN
include/linux/mfd/mc13xxx.h +17 -0
index cef1497..f24be68 100644
@@ -137,6 +137,22 @@ struct mc13xxx_leds_platform_data {
 	char tc3_period;
 };
 
+struct mc13xxx_buttons_platform_data {
+#define MC13783_BUTTON_DBNC_0MS		0
+#define MC13783_BUTTON_DBNC_30MS	1
+#define MC13783_BUTTON_DBNC_150MS	2
+#define MC13783_BUTTON_DBNC_750MS	3
+#define MC13783_BUTTON_ENABLE		(1 << 2)
+#define MC13783_BUTTON_POL_INVERT	(1 << 3)
+#define MC13783_BUTTON_RESET_EN		(1 << 4)
+	int b1on_flags;
+	unsigned short b1on_key;
+	int b2on_flags;
+	unsigned short b2on_key;
+	int b3on_flags;
+	unsigned short b3on_key;
+};
+
 struct mc13xxx_platform_data {
 #define MC13XXX_USE_TOUCHSCREEN (1 << 0)
 #define MC13XXX_USE_CODEC	(1 << 1)
@@ -146,6 +162,7 @@ struct mc13xxx_platform_data {
 
 	struct mc13xxx_regulator_platform_data regulators;
 	struct mc13xxx_leds_platform_data *leds;
+	struct mc13xxx_buttons_platform_data *buttons;
 };
 
 #endif /* ifndef __LINUX_MFD_MC13XXX_H */
Signature · 1 line
1.6.3.3
#6 lore raw

PATCH v6 6/6 mx31moboard: Add MC13783 power button support

Add the power-on button on mx31moboard using MC13783 PMIC.

---
 arch/arm/mach-imx/mach-mx31moboard.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-imx/mach-mx31moboard.c +8 -0
index 579ca1f..2a43492 100644
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/types.h>
 #include <linux/memblock.h>
+#include <linux/input.h>
 
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
@@ -264,12 +265,19 @@ static struct mc13783_leds_platform_data moboard_leds = {
 	.tc2_period = MC13783_LED_PERIOD_10MS,
 };
 
+static struct mc13783_buttons_platform_data moboard_buttons = {
+	.b1on_flags = MC13783_BUTTON_DBNC_750MS | MC13783_BUTTON_ENABLE |
+			MC13783_BUTTON_POL_INVERT,
+	.b1on_key = KEY_POWER,
+};
+
 static struct mc13xxx_platform_data moboard_pmic = {
 	.regulators = {
 		.regulators = moboard_regulators,
 		.num_regulators = ARRAY_SIZE(moboard_regulators),
 	},
 	.leds = &moboard_leds,
+	.buttons = &moboard_buttons,
 	.flags = MC13XXX_USE_RTC | MC13XXX_USE_ADC,
 };
 
Signature · 1 line
1.6.3.3
maintainer
#7 lore raw

PATCH 6/6 mx31moboard: Add MC13783 power button support

Quoted 3 lines · Philippe R?tornaz

Add the power-on button on mx31moboard using MC13783 PMIC.

Please ping once the rest is merged.

Sascha

Quoted 40 lines
---
 arch/arm/mach-imx/mach-mx31moboard.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-imx/mach-mx31moboard.c +8 -0
index 579ca1f..2a43492 100644
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/types.h>
 #include <linux/memblock.h>
+#include <linux/input.h>
 
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
@@ -264,12 +265,19 @@ static struct mc13783_leds_platform_data moboard_leds = {
 	.tc2_period = MC13783_LED_PERIOD_10MS,
 };
 
+static struct mc13783_buttons_platform_data moboard_buttons = {
+	.b1on_flags = MC13783_BUTTON_DBNC_750MS | MC13783_BUTTON_ENABLE |
+			MC13783_BUTTON_POL_INVERT,
+	.b1on_key = KEY_POWER,
+};
+
 static struct mc13xxx_platform_data moboard_pmic = {
 	.regulators = {
 		.regulators = moboard_regulators,
 		.num_regulators = ARRAY_SIZE(moboard_regulators),
 	},
 	.leds = &moboard_leds,
+	.buttons = &moboard_buttons,
 	.flags = MC13XXX_USE_RTC | MC13XXX_USE_ADC,
 };
 
Signature · 1 line
1.6.3.3
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
maintainer
#8 lore raw

PATCH 3/6 mc13xxx: remove obsolete leds and regulators flags

In reply to Philippe Rétornaz
Quoted 1 line · Philippe R?tornaz
Quoted 93 lines
---
 arch/arm/mach-imx/mach-mx27_3ds.c    |    1 -
 arch/arm/mach-imx/mach-mx31_3ds.c    |    2 +-
 arch/arm/mach-imx/mach-mx31lite.c    |    3 +--
 arch/arm/mach-imx/mach-mx31moboard.c |    3 +--
 arch/arm/mach-imx/mach-pcm038.c      |    3 +--
 arch/arm/mach-mx5/mx51_efika.c       |    2 +-
 6 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/mach-imx/mach-mx27_3ds.c +0 -1
index 6e1accf..8cd507d 100644
@@ -238,7 +238,6 @@ static struct mc13xxx_platform_data mc13783_pdata = {
 		.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
 
 	},
-	.flags  = MC13783_USE_REGULATOR,
 };
 
 /* SPI */
arch/arm/mach-imx/mach-mx31_3ds.c +1 -1
index 9b98244..7978f58 100644
@@ -496,7 +496,7 @@ static struct mc13xxx_platform_data mc13783_pdata = {
 		.regulators = mx31_3ds_regulators,
 		.num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
 	},
-	.flags  = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
+	.flags  = MC13783_USE_TOUCHSCREEN,
 };
 
 /* SPI */
arch/arm/mach-imx/mach-mx31lite.c +1 -2
index ac9b4ca..ae99cae 100644
@@ -112,8 +112,7 @@ static const struct spi_imx_master spi1_pdata __initconst = {
 };
 
 static struct mc13xxx_platform_data mc13783_pdata __initdata = {
-	.flags  = MC13XXX_USE_RTC |
-		  MC13XXX_USE_REGULATOR,
+	.flags  = MC13XXX_USE_RTC,
 };
 
 static struct spi_board_info mc13783_spi_dev __initdata = {
arch/arm/mach-imx/mach-mx31moboard.c +1 -2
index 12ee755..579ca1f 100644
@@ -270,8 +270,7 @@ static struct mc13xxx_platform_data moboard_pmic = {
 		.num_regulators = ARRAY_SIZE(moboard_regulators),
 	},
 	.leds = &moboard_leds,
-	.flags = MC13XXX_USE_REGULATOR | MC13XXX_USE_RTC |
-		MC13XXX_USE_ADC | MC13XXX_USE_LED,
+	.flags = MC13XXX_USE_RTC | MC13XXX_USE_ADC,
 };
 
 static struct spi_board_info moboard_spi_board_info[] __initdata = {
arch/arm/mach-imx/mach-pcm038.c +1 -2
index 853bb87..70aaa7d 100644
@@ -266,8 +266,7 @@ static struct mc13xxx_platform_data pcm038_pmic = {
 		.regulators = pcm038_regulators,
 		.num_regulators = ARRAY_SIZE(pcm038_regulators),
 	},
-	.flags = MC13783_USE_ADC | MC13783_USE_REGULATOR |
-		 MC13783_USE_TOUCHSCREEN,
+	.flags = MC13783_USE_ADC | MC13783_USE_TOUCHSCREEN,
 };
 
 static struct spi_board_info pcm038_spi_board_info[] __initdata = {
arch/arm/mach-mx5/mx51_efika.c +1 -1
index 1105ef3..e2e4096 100644
@@ -567,7 +567,7 @@ static struct mc13xxx_regulator_init_data mx51_efika_regulators[] = {
 };
 
 static struct mc13xxx_platform_data mx51_efika_mc13892_data = {
-	.flags = MC13XXX_USE_RTC | MC13XXX_USE_REGULATOR,
+	.flags = MC13XXX_USE_RTC,
 	.regulators = {
 		.num_regulators = ARRAY_SIZE(mx51_efika_regulators),
 		.regulators = mx51_efika_regulators,
Signature · 1 line
1.6.3.3
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#9 lore raw

v6 cover mc13783: add pwr button support

In reply to Philippe Rétornaz
Quoted 16 lines · Philippe Rétornaz

Hello

This add button handling for the MC13783 PMIC.

Patch 1 & 2 modify the mc13xxx MFD driver to use the platform data to resgister the led subdevice and unconditionally register the regulator subdevice (as suggested by Mark and Uwe).

Patch 3 remove the use of the *_USE_REGULATOR and *_USE_LED macros in the platform files.

Patch 4 must be applied after patch 1,2,3 to remove the obsolete define.

Patch 5 modify the mc13xxx MFD driver to add a button subdevice and also adds the mc13783-pwrbutton driver using a misc input device.

Quoted 8 lines

The last patch adds the power on button support to the mx31moboard boards.

v2: first patch modified according to comments by Dmitry Torokhov
v3: Implement review by Uwe
v4: Implement comments by Uwe and Mark
v5: Reorder patchset
v6: Minor corrections

It seems you did not address the comment about possible NULL pdata I put on v4?

Signature · 7 lines
Regards,
Shawn

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw

v6 cover mc13783: add pwr button support

Le dimanche 24 juillet 2011 05:44:19, Shawn Guo a ?crit :

Quoted 20 lines · Philippe R?tornaz
Quoted 19 lines

Hello

This add button handling for the MC13783 PMIC.

Patch 1 & 2 modify the mc13xxx MFD driver to use the platform data to resgister the led subdevice and unconditionally register the regulator subdevice (as suggested by Mark and Uwe).

Patch 3 remove the use of the *_USE_REGULATOR and *_USE_LED macros in the platform files.

Patch 4 must be applied after patch 1,2,3 to remove the obsolete define.

Patch 5 modify the mc13xxx MFD driver to add a button subdevice and also adds the mc13783-pwrbutton driver using a misc input device.

The last patch adds the power on button support to the mx31moboard boards.

Quoted 8 lines
Quoted 5 lines

v2: first patch modified according to comments by Dmitry Torokhov
v3: Implement review by Uwe
v4: Implement comments by Uwe and Mark
v5: Reorder patchset
v6: Minor corrections

It seems you did not address the comment about possible NULL pdata I put on v4?

Yes I did in patch 5:

drivers/mfd/mc13xxx-core.c +5 -0
@@ -716,6 +716,11 @@ static int mc13xxx_probe(struct spi_device *spi)
        enum mc13xxx_id id;
        int ret;
 
+       if (!pdata) {
+               dev_err(&spi->dev, "invalid platform data\n");
+               return -EINVAL;
+       }
+
 
 

Thanks,

Philippe

#11 lore raw

v6 cover mc13783: add pwr button support

Quoted 35 lines · Philippe Rétornaz
Quoted 20 lines · Shawn Guo
Quoted 19 lines · Philippe Rétornaz

Hello

This add button handling for the MC13783 PMIC.

Patch 1 & 2 modify the mc13xxx MFD driver to use the platform data to resgister the led subdevice and unconditionally register the regulator subdevice (as suggested by Mark and Uwe).

Patch 3 remove the use of the *_USE_REGULATOR and *_USE_LED macros in the platform files.

Patch 4 must be applied after patch 1,2,3 to remove the obsolete define.

Patch 5 modify the mc13xxx MFD driver to add a button subdevice and also adds the mc13783-pwrbutton driver using a misc input device.

The last patch adds the power on button support to the mx31moboard boards.

Quoted 8 lines
Quoted 5 lines

v2: first patch modified according to comments by Dmitry Torokhov
v3: Implement review by Uwe
v4: Implement comments by Uwe and Mark
v5: Reorder patchset
v6: Minor corrections

It seems you did not address the comment about possible NULL pdata I put on v4?

Yes I did in patch 5:

drivers/mfd/mc13xxx-core.c static int mc13xxx_probe(struct spi_device *spi) · line 724

Quoted 9 lines
drivers/mfd/mc13xxx-core.c +5 -0
@@ -716,6 +716,11 @@ static int mc13xxx_probe(struct spi_device *spi)
        enum mc13xxx_id id;
        int ret;
 
+       if (!pdata) {
+               dev_err(&spi->dev, "invalid platform data\n");
+               return -EINVAL;
+       }
+
 

Ah, missed that. I thought it should be fixed with a separate patch in the first place. But I'm fine with it, as long as it gets fixed :)

Signature · 7 lines
Regards,
Shawn

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

v6 cover mc13783: add pwr button support

In reply to Philippe Rétornaz
Quoted 45 lines · Philippe R?tornaz

Hello

This add button handling for the MC13783 PMIC.

Patch 1& 2 modify the mc13xxx MFD driver to use the platform data to resgister the led subdevice and unconditionally register the regulator subdevice (as suggested by Mark and Uwe).

Patch 3 remove the use of the *_USE_REGULATOR and *_USE_LED macros in the platform files.

Patch 4 must be applied after patch 1,2,3 to remove the obsolete define.

Patch 5 modify the mc13xxx MFD driver to add a button subdevice and also adds the mc13783-pwrbutton driver using a misc input device.

The last patch adds the power on button support to the mx31moboard boards.

v2: first patch modified according to comments by Dmitry Torokhov
v3: Implement review by Uwe
v4: Implement comments by Uwe and Mark
v5: Reorder patchset
v6: Minor corrections

Philippe R?tornaz (6):
mc13xxx: Unconditionally register regulator subdevice
mc13xxx: implicitly register led subdevice
mc13xxx: remove obsolete leds and regulators flags
mc13xxx: remove unused define
mc13783: add power button support
mx31moboard: Add MC13783 power button support

  arch/arm/mach-imx/mach-mx27_3ds.c      |    1 -
  arch/arm/mach-imx/mach-mx31_3ds.c      |    2 +-
  arch/arm/mach-imx/mach-mx31lite.c      |    3 +-
  arch/arm/mach-imx/mach-mx31moboard.c   |   11 +-
  arch/arm/mach-imx/mach-pcm038.c        |    3 +-
  arch/arm/mach-mx5/mx51_efika.c         |    2 +-
  drivers/input/misc/Kconfig             |   10 +
  drivers/input/misc/Makefile            |    1 +
  drivers/input/misc/mc13783-pwrbutton.c |  282 ++++++++++++++++++++++++++++++++
  drivers/mfd/mc13xxx-core.c             |   17 ++-
  include/linux/mfd/mc13783.h            |    3 +-
  include/linux/mfd/mc13xxx.h            |   19 ++-
  12 files changed, 336 insertions(+), 18 deletions(-)
Quoted 2 lines

create mode 100644 drivers/input/misc/mc13783-pwrbutton.c

Seems good now, cheers.

Signature · 3 lines
Thanks
Best Regards
Wanlong Gao
#13 lore raw

v6 cover mc13783: add pwr button support

In reply to Philippe Rétornaz

Hi Philippe,

Quoted 3 lines · Philippe Rétornaz

Hello

This add button handling for the MC13783 PMIC.

I suppose I should take this one. Sascha, are you ok with me doing so ? Also, are you fine with the imx changes ?

Cheers,
Samuel.

Signature · 6 lines
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#14 lore raw

v6 cover mc13783: add pwr button support

Le mercredi 27 juillet 2011 12:34:03, Samuel Ortiz a ?crit :

Quoted 7 lines · Philippe R?tornaz
Quoted 3 lines

Hello

This add button handling for the MC13783 PMIC.

I suppose I should take this one. Sascha, are you ok with me doing so ? Also, are you fine with the imx changes ?

Ping ?

Thanks !

Philippe