On Fri, Feb 18, 2011 at 10:38 PM, Lesly A M <[email protected]> wrote:
<snip>
> +int twl5030_get_si_ver(u32 *value)
> +{
> + int ret = 0;
> + static u32 twl_idcode;
> +
> + if (twl_idcode == 0)
> + ret = twl_read_idcode_register(&twl_idcode);
> + if (ret)
> + pr_err("TWL4030 Unable to check Si version\n");
this if block should be under if (twl_idcode == 0)
> +
> + if (TWL_SIL_TYPE(twl_idcode) == TWL_SIL_5030)
> + *value = TWL_SIL_REV(twl_idcode);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL(twl5030_get_si_ver);
> +
> static struct device *
> add_numbered_child(unsigned chip, const char *name, int num,
> void *pdata, unsigned pdata_len,
> diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
> index f4bd475..5d3f2bf 100644
> --- a/include/linux/i2c/twl.h
> +++ b/include/linux/i2c/twl.h
> @@ -150,7 +150,15 @@
> #define MMC_PU (0x1 << 3)
> #define MMC_PD (0x1 << 2)
>
> +#define R_UNLOCK_TEST_REG 0x12
> +#define TWL_EEPROM_R_UNLOCK 0x49
>
> +#define TWL_SIL_TYPE(rev) ((rev) & 0x00FFFFFF)
> +#define TWL_SIL_REV(rev) ((rev) >> 24)
> +#define TWL_SIL_5030 0x09002F
Is it 0x9802F or 0x09002F for TWL5030 ?
> +#define TWL5030_REV_1_0 0x00
> +#define TWL5030_REV_1_1 0x10
> +#define TWL5030_REV_1_2 0x30
>
> #define TWL4030_CLASS_ID 0x4030
> #define TWL6030_CLASS_ID 0x6030
> @@ -180,6 +188,8 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
> int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
> int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
>
> +int twl5030_get_si_ver(u32 *value);
> +
> int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
> int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
>
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html