From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Tyser Date: Wed, 10 Jun 2009 09:27:22 -0500 Subject: [U-Boot] [PATCH 3/4] ZOOM2 Add power reset button In-Reply-To: <1244638432-30893-4-git-send-email-Tom.Rix@windriver.com> References: <1244638432-30893-1-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-2-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-3-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-4-git-send-email-Tom.Rix@windriver.com> Message-ID: <1244644042.18811.2728.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, > diff --git a/drivers/i2c/twl4030_i2c.c b/drivers/i2c/twl4030_i2c.c > index 774f813..549f974 100644 > --- a/drivers/i2c/twl4030_i2c.c > +++ b/drivers/i2c/twl4030_i2c.c > @@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) > return i2c_read(chip_no, reg, 1, val, 1); > } > > +/* > + * Power Reset > + */ > +void twl4030_power_reset_init(void) > +{ > +#ifdef CONFIG_OMAP3_ZOOM2 > + u8 val = 0; > + if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val, > + TWL4030_PM_MASTER_P1_SW_EVENTS)) { > + printf("Error:TWL4030: failed to read the power register\n"); > + printf("Could not initialize hardware reset\n"); > + } else { > + val |= TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON; > + if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val, > + TWL4030_PM_MASTER_P1_SW_EVENTS)) { > + printf("Error:TWL4030: failed to write the power register\n"); > + printf("Could not initialize hardware reset\n"); > + } > + } > +#endif > +} > + All other drivers in drivers/i2c are host adapter drivers. Ie they implement i2c_read(), i2c_write(), i2c_probe(), and i2c_init(). The twl4030_i2c.c driver doesn't seem to fit this mold. Perhaps it would be better placed in drivers/misc or a new drivers/power directory similar to Linux? FWIW I had the same dilemma with the ds4510 i2c device which has support for GPIO, EEEPROM, etc and ended up putting it in drivers/misc. Best, Peter