Loading Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +16 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,7 @@ normally open. switch type on target typically the switch type will be normally open or normally close, value for this property 0 for normally close and 1 for normally open. - qcom,audio-routing : A list of the connections between audio components. - pinctrl-names : Pincntrl entries to configure the PDM gpio lines and cross connection switch gpio accordingly - pinctrl-0 : This explains the active state of the PDM gpio lines Loading @@ -532,6 +533,14 @@ normally open. gpio lines - pinctrl-3 : This explains the suspend state of the cross connection gpio lines - qcom,tapan-mclk-clk-freq : Tapan mclk Freq in Hz. - qcom,prim-auxpcm-gpio-clk : GPIO on which Primary AUXPCM clk signal is coming. - qcom,prim-auxpcm-gpio-sync : GPIO on which Primary AUXPCM SYNC signal is coming. - qcom,prim-auxpcm-gpio-din : GPIO on which Primary AUXPCM DIN signal is coming. - qcom,prim-auxpcm-gpio-dout : GPIO on which Primary AUXPCM DOUT signal is coming. - qcom,prim-auxpcm-gpio-set : set of GPIO lines used for Primary AUXPCM port - qcom,tapan-codec-9302: Indicates that this device node is for WCD9302 audio codec. Optional Properties: - qcom,us-euro-gpios : GPIO on which gnd/mic swap signal is coming. Loading Loading @@ -564,6 +573,13 @@ Example: pinctrl-1 = <&cdc_pdm_lines_sus>; pinctrl-2 = <&cross_conn_det_act>; pinctrl-3 = <&cross_conn_det_sus>; qcom,tapan-mclk-clk-freq = <9600000>; qcom,prim-auxpcm-gpio-clk = <&msm_gpio 63 0>; qcom,prim-auxpcm-gpio-sync = <&msm_gpio 64 0>; qcom,prim-auxpcm-gpio-din = <&msm_gpio 65 0>; qcom,prim-auxpcm-gpio-dout = <&msm_gpio 66 0>; qcom,prim-auxpcm-gpio-set = "prim-gpio-prim"; qcom,tapan-codec-9302; }; * MSM8974 ASoC Machine driver Loading drivers/mfd/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ obj-$(CONFIG_WCD9306_CODEC) += wcd9xxx-core.o wcd9xxx-irq.o\ wcd9xxx-slimslave.o wcd9xxx-core-resource.o obj-$(CONFIG_WCD9330_CODEC) += wcd9xxx-core.o wcd9xxx-irq.o wcd9xxx-slimslave.o\ wcd9xxx-core-resource.o obj-$(CONFIG_SND_SOC_MSM8X16_WCD) += wcd9xxx-core.o wcd9xxx-irq.o\ wcd9xxx-slimslave.o wcd9xxx-core-resource.o ifeq ($(CONFIG_SA1100_ASSABET),y) obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o Loading drivers/mfd/wcd9xxx-core.c +73 −7 Original line number Diff line number Diff line Loading @@ -64,6 +64,40 @@ struct wcd9xxx_i2c { int mod_id; }; struct pinctrl_info { struct pinctrl *pinctrl; struct pinctrl_state *extncodec_sus; struct pinctrl_state *extncodec_act; }; static struct pinctrl_info pinctrl_info; static int extcodec_get_pinctrl(struct device *dev) { struct pinctrl *pinctrl; pinctrl = pinctrl_get(dev); if (IS_ERR(pinctrl)) { pr_err("%s: Unable to get pinctrl handle\n", __func__); return -EINVAL; } pinctrl_info.pinctrl = pinctrl; /* get all the states handles from Device Tree */ pinctrl_info.extncodec_sus = pinctrl_lookup_state(pinctrl, "suspend"); if (IS_ERR(pinctrl_info.extncodec_sus)) { pr_err("%s: Unable to get pinctrl disable state handle, err: %ld\n", __func__, PTR_ERR(pinctrl_info.extncodec_sus)); return -EINVAL; } pinctrl_info.extncodec_act = pinctrl_lookup_state(pinctrl, "active"); if (IS_ERR(pinctrl_info.extncodec_act)) { pr_err("%s: Unable to get pinctrl disable state handle, err: %ld\n", __func__, PTR_ERR(pinctrl_info.extncodec_act)); return -EINVAL; } return 0; } static int wcd9xxx_dt_parse_vreg_info(struct device *dev, struct wcd9xxx_regulator *vreg, const char *vreg_name, bool ondemand); Loading Loading @@ -512,7 +546,8 @@ static int wcd9xxx_reset(struct wcd9xxx *wcd9xxx) { int ret; if (wcd9xxx->reset_gpio && wcd9xxx->slim_device_bootup) { if (wcd9xxx->reset_gpio && wcd9xxx->slim_device_bootup && !wcd9xxx->use_pinctrl) { ret = gpio_request(wcd9xxx->reset_gpio, "CDC_RESET"); if (ret) { pr_err("%s: Failed to request gpio %d\n", __func__, Loading @@ -522,19 +557,44 @@ static int wcd9xxx_reset(struct wcd9xxx *wcd9xxx) } } if (wcd9xxx->reset_gpio) { if (wcd9xxx->use_pinctrl) { /* Reset the CDC PDM TLMM pins to a default state */ ret = pinctrl_select_state(pinctrl_info.pinctrl, pinctrl_info.extncodec_act); if (ret != 0) { pr_err("%s: Failed to enable gpio pins; ret=%d\n", __func__, ret); return ret; } gpio_set_value_cansleep(wcd9xxx->reset_gpio, 0); msleep(20); gpio_set_value_cansleep(wcd9xxx->reset_gpio, 1); msleep(20); ret = pinctrl_select_state(pinctrl_info.pinctrl, pinctrl_info.extncodec_sus); if (ret != 0) { pr_err("%s: Failed to suspend reset pins, ret: %d\n", __func__, ret); return ret; } } else { gpio_direction_output(wcd9xxx->reset_gpio, 0); msleep(20); gpio_direction_output(wcd9xxx->reset_gpio, 1); msleep(20); } } return 0; } static void wcd9xxx_free_reset(struct wcd9xxx *wcd9xxx) { if (wcd9xxx->reset_gpio) { if (!wcd9xxx->use_pinctrl) { gpio_free(wcd9xxx->reset_gpio); wcd9xxx->reset_gpio = 0; } else pinctrl_put(pinctrl_info.pinctrl); } } Loading Loading @@ -1235,6 +1295,12 @@ static int wcd9xxx_i2c_probe(struct i2c_client *client, ret = -EINVAL; goto fail; } ret = extcodec_get_pinctrl(&client->dev); if (ret < 0) wcd9xxx->use_pinctrl = false; else wcd9xxx->use_pinctrl = true; if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { dev_dbg(&client->dev, "can't talk I2C?\n"); Loading include/linux/mfd/wcd9xxx/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ struct wcd9xxx { struct wcd9xxx_ch *rx_chs; struct wcd9xxx_ch *tx_chs; u32 mclk_rate; u16 use_pinctrl; const struct wcd9xxx_codec_type *codec_type; }; Loading sound/soc/codecs/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ snd-soc-wcd9330-objs := wcd9330.o wcd9330-tables.o snd-soc-wcd9xxx-objs := wcd9xxx-resmgr.o wcd9xxx-mbhc.o wcd9xxx-common.o snd-soc-msm8x10-wcd-objs := msm8x10-wcd.o msm8x10-wcd-tables.o wcd9xxx-common.o snd-soc-msm8x16-wcd-objs := msm8x16-wcd.o msm8x16-wcd-tables.o wcd-mbhc-v2.o snd-soc-msm8x16-wcd-objs += wcd9xxx-common.o wcd9xxx-resmgr.o wcd9xxx-mbhc.o snd-soc-msm8x16-wcd-objs += wcd9xxx-common.o wcd9306.o wcd9306-tables.o snd-soc-wcd-cpe-objs := wcd_cpe_services.o wcd_cpe_core.o snd-soc-wl1273-objs := wl1273.o snd-soc-wm-adsp-objs := wm_adsp.o Loading Loading
Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +16 −0 Original line number Diff line number Diff line Loading @@ -524,6 +524,7 @@ normally open. switch type on target typically the switch type will be normally open or normally close, value for this property 0 for normally close and 1 for normally open. - qcom,audio-routing : A list of the connections between audio components. - pinctrl-names : Pincntrl entries to configure the PDM gpio lines and cross connection switch gpio accordingly - pinctrl-0 : This explains the active state of the PDM gpio lines Loading @@ -532,6 +533,14 @@ normally open. gpio lines - pinctrl-3 : This explains the suspend state of the cross connection gpio lines - qcom,tapan-mclk-clk-freq : Tapan mclk Freq in Hz. - qcom,prim-auxpcm-gpio-clk : GPIO on which Primary AUXPCM clk signal is coming. - qcom,prim-auxpcm-gpio-sync : GPIO on which Primary AUXPCM SYNC signal is coming. - qcom,prim-auxpcm-gpio-din : GPIO on which Primary AUXPCM DIN signal is coming. - qcom,prim-auxpcm-gpio-dout : GPIO on which Primary AUXPCM DOUT signal is coming. - qcom,prim-auxpcm-gpio-set : set of GPIO lines used for Primary AUXPCM port - qcom,tapan-codec-9302: Indicates that this device node is for WCD9302 audio codec. Optional Properties: - qcom,us-euro-gpios : GPIO on which gnd/mic swap signal is coming. Loading Loading @@ -564,6 +573,13 @@ Example: pinctrl-1 = <&cdc_pdm_lines_sus>; pinctrl-2 = <&cross_conn_det_act>; pinctrl-3 = <&cross_conn_det_sus>; qcom,tapan-mclk-clk-freq = <9600000>; qcom,prim-auxpcm-gpio-clk = <&msm_gpio 63 0>; qcom,prim-auxpcm-gpio-sync = <&msm_gpio 64 0>; qcom,prim-auxpcm-gpio-din = <&msm_gpio 65 0>; qcom,prim-auxpcm-gpio-dout = <&msm_gpio 66 0>; qcom,prim-auxpcm-gpio-set = "prim-gpio-prim"; qcom,tapan-codec-9302; }; * MSM8974 ASoC Machine driver Loading
drivers/mfd/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ obj-$(CONFIG_WCD9306_CODEC) += wcd9xxx-core.o wcd9xxx-irq.o\ wcd9xxx-slimslave.o wcd9xxx-core-resource.o obj-$(CONFIG_WCD9330_CODEC) += wcd9xxx-core.o wcd9xxx-irq.o wcd9xxx-slimslave.o\ wcd9xxx-core-resource.o obj-$(CONFIG_SND_SOC_MSM8X16_WCD) += wcd9xxx-core.o wcd9xxx-irq.o\ wcd9xxx-slimslave.o wcd9xxx-core-resource.o ifeq ($(CONFIG_SA1100_ASSABET),y) obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o Loading
drivers/mfd/wcd9xxx-core.c +73 −7 Original line number Diff line number Diff line Loading @@ -64,6 +64,40 @@ struct wcd9xxx_i2c { int mod_id; }; struct pinctrl_info { struct pinctrl *pinctrl; struct pinctrl_state *extncodec_sus; struct pinctrl_state *extncodec_act; }; static struct pinctrl_info pinctrl_info; static int extcodec_get_pinctrl(struct device *dev) { struct pinctrl *pinctrl; pinctrl = pinctrl_get(dev); if (IS_ERR(pinctrl)) { pr_err("%s: Unable to get pinctrl handle\n", __func__); return -EINVAL; } pinctrl_info.pinctrl = pinctrl; /* get all the states handles from Device Tree */ pinctrl_info.extncodec_sus = pinctrl_lookup_state(pinctrl, "suspend"); if (IS_ERR(pinctrl_info.extncodec_sus)) { pr_err("%s: Unable to get pinctrl disable state handle, err: %ld\n", __func__, PTR_ERR(pinctrl_info.extncodec_sus)); return -EINVAL; } pinctrl_info.extncodec_act = pinctrl_lookup_state(pinctrl, "active"); if (IS_ERR(pinctrl_info.extncodec_act)) { pr_err("%s: Unable to get pinctrl disable state handle, err: %ld\n", __func__, PTR_ERR(pinctrl_info.extncodec_act)); return -EINVAL; } return 0; } static int wcd9xxx_dt_parse_vreg_info(struct device *dev, struct wcd9xxx_regulator *vreg, const char *vreg_name, bool ondemand); Loading Loading @@ -512,7 +546,8 @@ static int wcd9xxx_reset(struct wcd9xxx *wcd9xxx) { int ret; if (wcd9xxx->reset_gpio && wcd9xxx->slim_device_bootup) { if (wcd9xxx->reset_gpio && wcd9xxx->slim_device_bootup && !wcd9xxx->use_pinctrl) { ret = gpio_request(wcd9xxx->reset_gpio, "CDC_RESET"); if (ret) { pr_err("%s: Failed to request gpio %d\n", __func__, Loading @@ -522,19 +557,44 @@ static int wcd9xxx_reset(struct wcd9xxx *wcd9xxx) } } if (wcd9xxx->reset_gpio) { if (wcd9xxx->use_pinctrl) { /* Reset the CDC PDM TLMM pins to a default state */ ret = pinctrl_select_state(pinctrl_info.pinctrl, pinctrl_info.extncodec_act); if (ret != 0) { pr_err("%s: Failed to enable gpio pins; ret=%d\n", __func__, ret); return ret; } gpio_set_value_cansleep(wcd9xxx->reset_gpio, 0); msleep(20); gpio_set_value_cansleep(wcd9xxx->reset_gpio, 1); msleep(20); ret = pinctrl_select_state(pinctrl_info.pinctrl, pinctrl_info.extncodec_sus); if (ret != 0) { pr_err("%s: Failed to suspend reset pins, ret: %d\n", __func__, ret); return ret; } } else { gpio_direction_output(wcd9xxx->reset_gpio, 0); msleep(20); gpio_direction_output(wcd9xxx->reset_gpio, 1); msleep(20); } } return 0; } static void wcd9xxx_free_reset(struct wcd9xxx *wcd9xxx) { if (wcd9xxx->reset_gpio) { if (!wcd9xxx->use_pinctrl) { gpio_free(wcd9xxx->reset_gpio); wcd9xxx->reset_gpio = 0; } else pinctrl_put(pinctrl_info.pinctrl); } } Loading Loading @@ -1235,6 +1295,12 @@ static int wcd9xxx_i2c_probe(struct i2c_client *client, ret = -EINVAL; goto fail; } ret = extcodec_get_pinctrl(&client->dev); if (ret < 0) wcd9xxx->use_pinctrl = false; else wcd9xxx->use_pinctrl = true; if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { dev_dbg(&client->dev, "can't talk I2C?\n"); Loading
include/linux/mfd/wcd9xxx/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ struct wcd9xxx { struct wcd9xxx_ch *rx_chs; struct wcd9xxx_ch *tx_chs; u32 mclk_rate; u16 use_pinctrl; const struct wcd9xxx_codec_type *codec_type; }; Loading
sound/soc/codecs/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ snd-soc-wcd9330-objs := wcd9330.o wcd9330-tables.o snd-soc-wcd9xxx-objs := wcd9xxx-resmgr.o wcd9xxx-mbhc.o wcd9xxx-common.o snd-soc-msm8x10-wcd-objs := msm8x10-wcd.o msm8x10-wcd-tables.o wcd9xxx-common.o snd-soc-msm8x16-wcd-objs := msm8x16-wcd.o msm8x16-wcd-tables.o wcd-mbhc-v2.o snd-soc-msm8x16-wcd-objs += wcd9xxx-common.o wcd9xxx-resmgr.o wcd9xxx-mbhc.o snd-soc-msm8x16-wcd-objs += wcd9xxx-common.o wcd9306.o wcd9306-tables.o snd-soc-wcd-cpe-objs := wcd_cpe_services.o wcd_cpe_core.o snd-soc-wl1273-objs := wl1273.o snd-soc-wm-adsp-objs := wm_adsp.o Loading