Skip to contentSkip to conversation

i2c: MPC8349E-mITX Power Management and GPIO expander driver

PATCH Applied Anton Vorontsov 3 participants 6 messages Sep 23, 2008 – Oct 10, 2008 2 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 i2c: MPC8349E-mITX Power Management and GPIO expander driver

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a Freescale MC9S08QG8 (MCU) chip with the custom firmware pre-programmed. The chip is used to power-off the board by the software, and to control some GPIO pins.

---
 drivers/i2c/chips/Kconfig            |   11 ++
 drivers/i2c/chips/Makefile           |    1 +
 drivers/i2c/chips/mcu_mpc8349emitx.c |  209 ++++++++++++++++++++++++++++++++++
 3 files changed, 221 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/mcu_mpc8349emitx.c
drivers/i2c/chips/Kconfig +11 -0
index a95cb94..1735682 100644
@@ -172,4 +172,15 @@ config MENELAUS
 	  and other features that are often used in portable devices like
 	  cell phones and PDAs.
 
+config MCU_MPC8349EMITX
+	tristate "MPC8349E-mITX MCU driver"
+	depends on I2C && PPC_83xx
+	select GENERIC_GPIO
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Say Y here to enable soft power-off functionality on the Freescale
+	  boards with the MPC8349E-mITX-compatible MCU chips. This driver will
+	  also register MCU GPIOs with the generic GPIO API, so you'll able
+	  to use MCU pins as GPIOs.
+
 endmenu
drivers/i2c/chips/Makefile +1 -0
index 39e3e69..ca520fa 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
 obj-$(CONFIG_MENELAUS)		+= menelaus.o
 obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
+obj-$(CONFIG_MCU_MPC8349EMITX)	+= mcu_mpc8349emitx.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/i2c/chips/mcu_mpc8349emitx.c new file +209 -0

209 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 5 lines · Anton Vorontsov

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a Freescale MC9S08QG8 (MCU) chip with the custom firmware pre-programmed. The chip is used to power-off the board by the software, and to control some GPIO pins.

Quoted 8 lines

---

drivers/i2c/chips/Kconfig            |   11 ++
drivers/i2c/chips/Makefile           |    1 +
drivers/i2c/chips/mcu_mpc8349emitx.c |  209 +++++++++++++++++++++++++ 
+++++++++
3 files changed, 221 insertions(+), 0 deletions(-)

create mode 100644 drivers/i2c/chips/mcu_mpc8349emitx.c

is the plan to connect ppc_md.machine_shutdown() with this?

- k

#2 lore raw
Quoted 17 lines · Kumar Gala
Quoted 5 lines · Anton Vorontsov

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a Freescale MC9S08QG8 (MCU) chip with the custom firmware pre-programmed. The chip is used to power-off the board by the software, and to control some GPIO pins.

Quoted 8 lines

---

drivers/i2c/chips/Kconfig            |   11 ++
drivers/i2c/chips/Makefile           |    1 +
drivers/i2c/chips/mcu_mpc8349emitx.c |  209 +++++++++++++++++++++++++ 
+++++++++
3 files changed, 221 insertions(+), 0 deletions(-)

create mode 100644 drivers/i2c/chips/mcu_mpc8349emitx.c

Quoted 1 line

is the plan to connect ppc_md.machine_shutdown() with this?

You mean poweroff? It's already connected.

+ /* XXX: this is potentially racy, but there is no lock for ppc_md */
+ if (!ppc_md.power_off) {

+               glob_mcu = mcu;
+               ppc_md.power_off = mcu_power_off;
+               dev_info(&client->dev, "will provide power-off service\n");

+ }

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2

A message that is not in the archive (sent off-list or not yet received): 20081010144545.GA956-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org

#4 lore raw
Quoted 29 lines · Anton Vorontsov
Quoted 18 lines · Kumar Gala
Quoted 6 lines · Anton Vorontsov

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a Freescale MC9S08QG8 (MCU) chip with the custom firmware pre-programmed. The chip is used to power-off the board by the software, and to control some GPIO pins.

Quoted 8 lines

---

drivers/i2c/chips/Kconfig            |   11 ++
drivers/i2c/chips/Makefile           |    1 +
drivers/i2c/chips/mcu_mpc8349emitx.c |  209 +++++++++++++++++++++++ 
++
+++++++++
3 files changed, 221 insertions(+), 0 deletions(-)

create mode 100644 drivers/i2c/chips/mcu_mpc8349emitx.c

Quoted 1 line

is the plan to connect ppc_md.machine_shutdown() with this?

You mean poweroff? It's already connected.

+ /* XXX: this is potentially racy, but there is no lock for
ppc_md */

drivers/i2c/chips/mcu_mpc8349emitx.c new file +4 -0
+       if (!ppc_md.power_off) {
+               glob_mcu = mcu;
+               ppc_md.power_off = mcu_power_off;
+               dev_info(&client->dev, "will provide power-off  
Quoted 2 lines

service\n");
+ }

uuh, yeah.. poweroff :)

and look at that. Is this in Jean's queue?

- k

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

#5 lore raw

On Fri, Oct 10, 2008 at 09:58:44AM -0500, Kumar Gala wrote:
[...]

Quoted 14 lines
Quoted 10 lines
Quoted 1 line

is the plan to connect ppc_md.machine_shutdown() with this?

You mean poweroff? It's already connected.

+ /* XXX: this is potentially racy, but there is no lock for
ppc_md */

drivers/i2c/chips/mcu_mpc8349emitx.c new file +4 -0
+       if (!ppc_md.power_off) {
+               glob_mcu = mcu;
+               ppc_md.power_off = mcu_power_off;
+               dev_info(&client->dev, "will provide power-off  
Quoted 2 lines

service\n");
+ }

Quoted 3 lines

uuh, yeah.. poweroff :)

and look at that. Is this in Jean's queue?

Nope. Here's what Jean wrote:

Quoted 3 lines · Jean Delvare

I do not have the time to review these patches (and, honestly, have no interest in them.) So I will not merge them but I have no objection to them being merged by somebody else.

So.. I think it could easily go through the powerpc tree.

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2

A message that is not in the archive (sent off-list or not yet received): 20080923141300.GB31262-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org

Applied
#7 lore raw
Quoted 5 lines · Anton Vorontsov

On MPC8349E-mITX, MPC8315E-RDB and MPC837x-RDB boards there is a Freescale MC9S08QG8 (MCU) chip with the custom firmware pre-programmed. The chip is used to power-off the board by the software, and to control some GPIO pins.

Quoted 8 lines

---

drivers/i2c/chips/Kconfig            |   11 ++
drivers/i2c/chips/Makefile           |    1 +
drivers/i2c/chips/mcu_mpc8349emitx.c |  209 +++++++++++++++++++++++++ 
+++++++++
3 files changed, 221 insertions(+), 0 deletions(-)

create mode 100644 drivers/i2c/chips/mcu_mpc8349emitx.c

applied

- k

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c