diff options
author | Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org> | 2016-07-14 01:17:05 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-07-15 17:01:55 -0700 |
commit | c404b25ea3474dd9f4826da40395c5781b78e2c3 (patch) | |
tree | aedfcafae8f8b66e5c13404a7df207e49b12ca15 /drivers | |
parent | 5be00f77d3d546cee287e061d765ab4cd4aa807e (diff) |
ASoC: wcd9xxx: add support for wcd934x codec
Add wcd934x as a mfd child and configure regmap.
Configure MCLK as per the HW sequence.
CRs-Fixed: 1041199
Change-Id: I9e2dbb0f0acaa1442c1624556bc52abf98158c92
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/wcd9xxx-core.c | 6 | ||||
-rw-r--r-- | drivers/mfd/wcd9xxx-regmap.h | 11 | ||||
-rw-r--r-- | drivers/mfd/wcd9xxx-utils.c | 12 |
3 files changed, 25 insertions, 4 deletions
diff --git a/drivers/mfd/wcd9xxx-core.c b/drivers/mfd/wcd9xxx-core.c index a32a20e19567..31ac6624b8b4 100644 --- a/drivers/mfd/wcd9xxx-core.c +++ b/drivers/mfd/wcd9xxx-core.c @@ -87,6 +87,7 @@ static const int wcd9xxx_cdc_types[] = { [WCD9XXX] = WCD9XXX, [WCD9330] = WCD9330, [WCD9335] = WCD9335, + [WCD934X] = WCD934X, }; static const struct of_device_id wcd9xxx_of_match[] = { @@ -326,7 +327,7 @@ int wcd9xxx_slim_write_repeat(struct wcd9xxx *wcd9xxx, unsigned short reg, struct slim_ele_access slim_msg; mutex_lock(&wcd9xxx->io_lock); - if (wcd9xxx->type == WCD9335) { + if (wcd9xxx->type == WCD9335 || wcd9xxx->type == WCD934X) { ret = wcd9xxx_page_write(wcd9xxx, ®); if (ret) goto done; @@ -1321,7 +1322,7 @@ static int wcd9xxx_slim_probe(struct slim_device *slim) * Vout_D to be ready after BUCK_SIDO is powered up. * SYS_RST_N shouldn't be pulled high during this time */ - if (wcd9xxx->type == WCD9335) + if (wcd9xxx->type == WCD9335 || wcd9xxx->type == WCD934X) usleep_range(600, 650); else usleep_range(5, 10); @@ -1555,6 +1556,7 @@ static const struct slim_device_id wcd_slim_device_id[] = { {"tapan-slim-pgd", 0}, {"tomtom-slim-pgd", WCD9330}, {"tasha-slim-pgd", WCD9335}, + {"tavil-slim-pgd", WCD934X}, {} }; diff --git a/drivers/mfd/wcd9xxx-regmap.h b/drivers/mfd/wcd9xxx-regmap.h index bca3962b30bb..62e4a620c71c 100644 --- a/drivers/mfd/wcd9xxx-regmap.h +++ b/drivers/mfd/wcd9xxx-regmap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -19,6 +19,10 @@ typedef int (*regmap_patch_fptr)(struct regmap *, int); +#ifdef CONFIG_WCD934X_CODEC +extern struct regmap_config wcd934x_regmap_config; +#endif + #ifdef CONFIG_WCD9335_CODEC extern struct regmap_config wcd9335_regmap_config; extern int wcd9335_regmap_register_patch(struct regmap *regmap, @@ -34,6 +38,11 @@ static inline struct regmap_config *wcd9xxx_get_regmap_config(int type) struct regmap_config *regmap_config; switch (type) { +#ifdef CONFIG_WCD934X_CODEC + case WCD934X: + regmap_config = &wcd934x_regmap_config; + break; +#endif #ifdef CONFIG_WCD9335_CODEC case WCD9335: regmap_config = &wcd9335_regmap_config; diff --git a/drivers/mfd/wcd9xxx-utils.c b/drivers/mfd/wcd9xxx-utils.c index 52346b551481..2160dfd063b1 100644 --- a/drivers/mfd/wcd9xxx-utils.c +++ b/drivers/mfd/wcd9xxx-utils.c @@ -37,6 +37,12 @@ static enum wcd9xxx_intf_status wcd9xxx_intf = -1; +static struct mfd_cell tavil_devs[] = { + { + .name = "tavil_codec", + }, +}; + static struct mfd_cell tasha_devs[] = { { .name = "tasha_codec", @@ -418,7 +424,7 @@ int wcd9xxx_page_write(struct wcd9xxx *wcd9xxx, unsigned short *reg) unsigned short c_reg, reg_addr; u8 pg_num, prev_pg_num; - if (wcd9xxx->type != WCD9335) + if (wcd9xxx->type != WCD9335 && wcd9xxx->type != WCD934X) return ret; c_reg = *reg; @@ -815,6 +821,10 @@ int wcd9xxx_get_codec_info(struct device *dev) } switch (wcd9xxx->type) { + case WCD934X: + cinfo->dev = tavil_devs; + cinfo->size = ARRAY_SIZE(tavil_devs); + break; case WCD9335: cinfo->dev = tasha_devs; cinfo->size = ARRAY_SIZE(tasha_devs); |