Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb40da7e authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

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: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 70d7c069
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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);
+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,13 @@
#define TOMTOM_IS_1_0(ver) \
	((ver == TOMTOM_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,