9
0
Fork 0

mc13xxx: Added mc13xxx_revision() function.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Alexander Shiyan 2012-08-04 13:15:53 +04:00 committed by Sascha Hauer
parent 58713d3274
commit e377a9d966
4 changed files with 14 additions and 2 deletions

View File

@ -307,7 +307,7 @@ static int ccxmx51_power_init(void)
mc13xxx_reg_write(mc13xxx_dev, MC13892_REG_SW_2, val);
}
if (mc13xxx_dev->revision <= MC13892_REVISION_2_0) {
if (mc13xxx_revision(mc13xxx_dev) <= MC13892_REVISION_2_0) {
/* Set switchers in PWM mode for Atlas 2.0 and lower */
/* Setup the switcher mode for SW1 & SW2*/
mc13xxx_reg_read(mc13xxx_dev, MC13892_REG_SW_4, &val);

View File

@ -178,7 +178,7 @@ static void babbage_power_init(void)
mc13xxx_reg_write(mc13xxx, MC13892_REG_SW_2, val);
}
if (mc13xxx->revision < MC13892_REVISION_2_0) {
if (mc13xxx_revision(mc13xxx) < MC13892_REVISION_2_0) {
/* Set switchers in PWM mode for Atlas 2.0 and lower */
/* Setup the switcher mode for SW1 & SW2*/
mc13xxx_reg_read(mc13xxx, MC13892_REG_SW_4, &val);

View File

@ -42,6 +42,12 @@ struct mc13xxx *mc13xxx_get(void)
}
EXPORT_SYMBOL(mc13xxx_get);
int mc13xxx_revision(struct mc13xxx *mc13xxx)
{
return mc13xxx->revision;
}
EXPORT_SYMBOL(mc13xxx_revision);
#ifdef CONFIG_SPI
static int spi_rw(struct spi_device *spi, void * buf, size_t len)
{

View File

@ -165,6 +165,7 @@ struct mc13xxx {
#ifdef CONFIG_MFD_MC13XXX
extern struct mc13xxx *mc13xxx_get(void);
extern int mc13xxx_revision(struct mc13xxx *mc13xxx);
extern int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val);
extern int mc13xxx_reg_write(struct mc13xxx *mc13xxx, u8 reg, u32 val);
extern int mc13xxx_set_bits(struct mc13xxx *mc13xxx, u8 reg, u32 mask, u32 val);
@ -174,6 +175,11 @@ static inline struct mc13xxx *mc13xxx_get(void)
return NULL;
}
static inline int mc13xxx_revision(struct mc13xxx *mc13xxx)
{
return -ENODEV;
}
static inline int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val)
{
return -ENODEV;