drivers: mfd: Detect and update the wcd9335 version

Add support to detect the wcd9335 codec version and
define macros for wcd9335 1.0 and 1.1 so that codec
driver can use these macros to update the register
configuration.

Change-Id: Ibb497bfb857addb9c7e8db37828c0096979d2c3c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
This commit is contained in:
Phani Kumar Uppalapati 2015-06-09 00:15:08 -07:00 committed by Aravind Kumar
parent ab5405aed8
commit d99df6a178
2 changed files with 16 additions and 1 deletions

View File

@ -773,7 +773,7 @@ static const struct wcd9xxx_codec_type wcd9xxx_codecs[] = {
},
{
TASHA_MAJOR, cpu_to_le16(0x0), tasha_devs,
ARRAY_SIZE(tasha_devs), TASHA_NUM_IRQS, 1,
ARRAY_SIZE(tasha_devs), TASHA_NUM_IRQS, -1,
WCD9XXX_SLIM_SLAVE_ADDR_TYPE_TAIKO, 0x01
},
};
@ -992,6 +992,14 @@ static const struct wcd9xxx_codec_type
} else {
if (d->version > -1) {
*version = d->version;
} else if (d->id_major == TASHA_MAJOR) {
rc = __wcd9xxx_reg_read(wcd9xxx,
WCD9335_CHIP_TIER_CTRL_EFUSE_VAL_OUT0);
if (rc < 0) {
d = NULL;
goto exit;
}
*version = ((u8)rc & 0x80) >> 7;
} else {
rc = __wcd9xxx_reg_read(wcd9xxx,
WCD9XXX_A_CHIP_VERSION);

View File

@ -52,6 +52,13 @@
#define TOMBAK_IS_1_0(ver) \
((ver == TOMBAK_VERSION_1_0) ? 1 : 0)
#define TASHA_VERSION_1_0 0
#define TASHA_VERSION_1_1 1
#define TASHA_IS_1_0(ver) \
((ver == TASHA_VERSION_1_0) ? 1 : 0)
#define TASHA_IS_1_1(ver) \
((ver == TASHA_VERSION_1_1) ? 1 : 0)
enum wcd9xxx_slim_slave_addr_type {
WCD9XXX_SLIM_SLAVE_ADDR_TYPE_TABLA,
WCD9XXX_SLIM_SLAVE_ADDR_TYPE_TAIKO,