Loading asoc/codecs/bolero/rx-macro.c +38 −19 Original line number Diff line number Diff line Loading @@ -764,6 +764,7 @@ static int rx_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (rx_priv->swr_ctrl_data) ret = swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -1152,6 +1153,7 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, rx_priv->is_native_on) || (rx_priv->clk_id == RX_CORE_CLK && !rx_priv->is_native_on)) { if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_DOWN, NULL); Loading @@ -1159,6 +1161,7 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, } if (rx_priv->is_native_on) mclk_freq = MCLK_FREQ_NATIVE; if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_CLK_FREQ, &mclk_freq); Loading Loading @@ -1213,12 +1216,14 @@ static int rx_macro_event_handler(struct snd_soc_component *component, break; case BOLERO_MACRO_EVT_SSR_DOWN: rx_priv->dev_up = false; if (rx_priv->swr_ctrl_data) { swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: rx_priv->dev_up = true; Loading @@ -1237,6 +1242,7 @@ static int rx_macro_event_handler(struct snd_soc_component *component, rx_priv->default_clk_id, RX_CORE_CLK, false); if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading Loading @@ -3570,6 +3576,8 @@ static int rx_macro_probe(struct platform_device *pdev) int ret = 0; u8 bcl_pmic_params[3]; u32 default_clk_id = 0; u32 is_used_rx_swr_gpio = 1; const char *is_used_rx_swr_gpio_dt = "qcom,is-used-swr-gpio"; rx_priv = devm_kzalloc(&pdev->dev, sizeof(struct rx_macro_priv), GFP_KERNEL); Loading Loading @@ -3598,9 +3606,20 @@ static int rx_macro_probe(struct platform_device *pdev) __func__, "qcom,default-clk-id"); default_clk_id = RX_CORE_CLK; } if (of_find_property(pdev->dev.of_node, is_used_rx_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_rx_swr_gpio_dt, &is_used_rx_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_rx_swr_gpio_dt); is_used_rx_swr_gpio = 1; } } rx_priv->rx_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,rx-swr-gpios", 0); if (!rx_priv->rx_swr_gpio_p) { if (!rx_priv->rx_swr_gpio_p && is_used_rx_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading asoc/codecs/bolero/tx-macro.c +36 −17 Original line number Diff line number Diff line Loading @@ -346,16 +346,19 @@ static int tx_macro_event_handler(struct snd_soc_component *component, switch (event) { case BOLERO_MACRO_EVT_SSR_DOWN: if (tx_priv->swr_ctrl_data) { swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */ tx_priv->reset_swr = true; if (tx_priv->swr_ctrl_data) swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading @@ -375,6 +378,7 @@ static int tx_macro_reg_wake_irq(struct snd_soc_component *component, if (!tx_macro_get_data(component, &tx_dev, &tx_priv, __func__)) return -EINVAL; if (tx_priv->swr_ctrl_data) ret = swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_REGISTER_WAKE_IRQ, &ipc_wakeup); Loading Loading @@ -1948,6 +1952,7 @@ static int tx_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (tx_priv->swr_ctrl_data) ret = swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -1977,6 +1982,8 @@ static int tx_macro_probe(struct platform_device *pdev) char __iomem *tx_io_base = NULL; int ret = 0; const char *dmic_sample_rate = "qcom,tx-dmic-sample-rate"; u32 is_used_tx_swr_gpio = 1; const char *is_used_tx_swr_gpio_dt = "qcom,is-used-swr-gpio"; tx_priv = devm_kzalloc(&pdev->dev, sizeof(struct tx_macro_priv), GFP_KERNEL); Loading @@ -1993,9 +2000,20 @@ static int tx_macro_probe(struct platform_device *pdev) return ret; } dev_set_drvdata(&pdev->dev, tx_priv); if (of_find_property(pdev->dev.of_node, is_used_tx_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_tx_swr_gpio_dt, &is_used_tx_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_tx_swr_gpio_dt); is_used_tx_swr_gpio = 1; } } tx_priv->tx_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,tx-swr-gpios", 0); if (!tx_priv->tx_swr_gpio_p) { if (!tx_priv->tx_swr_gpio_p && is_used_tx_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading Loading @@ -2064,6 +2082,7 @@ static int tx_macro_remove(struct platform_device *pdev) if (!tx_priv) return -EINVAL; if (tx_priv->swr_ctrl_data) kfree(tx_priv->swr_ctrl_data); for (count = 0; count < tx_priv->child_count && count < TX_MACRO_CHILD_DEVICES_MAX; count++) Loading asoc/codecs/bolero/wsa-macro.c +42 −22 Original line number Diff line number Diff line Loading @@ -473,6 +473,7 @@ static int wsa_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (wsa_priv->swr_ctrl_data) ret = swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -910,16 +911,19 @@ static int wsa_macro_event_handler(struct snd_soc_component *component, switch (event) { case BOLERO_MACRO_EVT_SSR_DOWN: if (wsa_priv->swr_ctrl_data) { swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */ wsa_priv->reset_swr = true; if (wsa_priv->swr_ctrl_data) swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading Loading @@ -1135,12 +1139,14 @@ static int wsa_macro_enable_swr(struct snd_soc_dapm_widget *w, wsa_priv->rx_1_count++; ch_cnt = wsa_priv->rx_0_count + wsa_priv->rx_1_count; if (wsa_priv->swr_ctrl_data) { swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_UP, NULL); swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_NUM_RX_CH, &ch_cnt); } break; case SND_SOC_DAPM_POST_PMD: if (!(strnstr(w->name, "RX0", sizeof("WSA_RX0"))) && Loading @@ -1151,6 +1157,7 @@ static int wsa_macro_enable_swr(struct snd_soc_dapm_widget *w, wsa_priv->rx_1_count--; ch_cnt = wsa_priv->rx_0_count + wsa_priv->rx_1_count; if (wsa_priv->swr_ctrl_data) swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_NUM_RX_CH, &ch_cnt); Loading Loading @@ -2880,6 +2887,8 @@ static int wsa_macro_probe(struct platform_device *pdev) char __iomem *wsa_io_base; int ret = 0; u8 bcl_pmic_params[3]; u32 is_used_wsa_swr_gpio = 1; const char *is_used_wsa_swr_gpio_dt = "qcom,is-used-swr-gpio"; wsa_priv = devm_kzalloc(&pdev->dev, sizeof(struct wsa_macro_priv), GFP_KERNEL); Loading @@ -2894,9 +2903,20 @@ static int wsa_macro_probe(struct platform_device *pdev) __func__, "reg"); return ret; } if (of_find_property(pdev->dev.of_node, is_used_wsa_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_wsa_swr_gpio_dt, &is_used_wsa_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_wsa_swr_gpio_dt); is_used_wsa_swr_gpio = 1; } } wsa_priv->wsa_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,wsa-swr-gpios", 0); if (!wsa_priv->wsa_swr_gpio_p) { if (!wsa_priv->wsa_swr_gpio_p && is_used_wsa_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading Loading
asoc/codecs/bolero/rx-macro.c +38 −19 Original line number Diff line number Diff line Loading @@ -764,6 +764,7 @@ static int rx_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (rx_priv->swr_ctrl_data) ret = swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -1152,6 +1153,7 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, rx_priv->is_native_on) || (rx_priv->clk_id == RX_CORE_CLK && !rx_priv->is_native_on)) { if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_DOWN, NULL); Loading @@ -1159,6 +1161,7 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, } if (rx_priv->is_native_on) mclk_freq = MCLK_FREQ_NATIVE; if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_CLK_FREQ, &mclk_freq); Loading Loading @@ -1213,12 +1216,14 @@ static int rx_macro_event_handler(struct snd_soc_component *component, break; case BOLERO_MACRO_EVT_SSR_DOWN: rx_priv->dev_up = false; if (rx_priv->swr_ctrl_data) { swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: rx_priv->dev_up = true; Loading @@ -1237,6 +1242,7 @@ static int rx_macro_event_handler(struct snd_soc_component *component, rx_priv->default_clk_id, RX_CORE_CLK, false); if (rx_priv->swr_ctrl_data) swrm_wcd_notify( rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading Loading @@ -3570,6 +3576,8 @@ static int rx_macro_probe(struct platform_device *pdev) int ret = 0; u8 bcl_pmic_params[3]; u32 default_clk_id = 0; u32 is_used_rx_swr_gpio = 1; const char *is_used_rx_swr_gpio_dt = "qcom,is-used-swr-gpio"; rx_priv = devm_kzalloc(&pdev->dev, sizeof(struct rx_macro_priv), GFP_KERNEL); Loading Loading @@ -3598,9 +3606,20 @@ static int rx_macro_probe(struct platform_device *pdev) __func__, "qcom,default-clk-id"); default_clk_id = RX_CORE_CLK; } if (of_find_property(pdev->dev.of_node, is_used_rx_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_rx_swr_gpio_dt, &is_used_rx_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_rx_swr_gpio_dt); is_used_rx_swr_gpio = 1; } } rx_priv->rx_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,rx-swr-gpios", 0); if (!rx_priv->rx_swr_gpio_p) { if (!rx_priv->rx_swr_gpio_p && is_used_rx_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading
asoc/codecs/bolero/tx-macro.c +36 −17 Original line number Diff line number Diff line Loading @@ -346,16 +346,19 @@ static int tx_macro_event_handler(struct snd_soc_component *component, switch (event) { case BOLERO_MACRO_EVT_SSR_DOWN: if (tx_priv->swr_ctrl_data) { swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */ tx_priv->reset_swr = true; if (tx_priv->swr_ctrl_data) swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading @@ -375,6 +378,7 @@ static int tx_macro_reg_wake_irq(struct snd_soc_component *component, if (!tx_macro_get_data(component, &tx_dev, &tx_priv, __func__)) return -EINVAL; if (tx_priv->swr_ctrl_data) ret = swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_REGISTER_WAKE_IRQ, &ipc_wakeup); Loading Loading @@ -1948,6 +1952,7 @@ static int tx_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (tx_priv->swr_ctrl_data) ret = swrm_wcd_notify( tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -1977,6 +1982,8 @@ static int tx_macro_probe(struct platform_device *pdev) char __iomem *tx_io_base = NULL; int ret = 0; const char *dmic_sample_rate = "qcom,tx-dmic-sample-rate"; u32 is_used_tx_swr_gpio = 1; const char *is_used_tx_swr_gpio_dt = "qcom,is-used-swr-gpio"; tx_priv = devm_kzalloc(&pdev->dev, sizeof(struct tx_macro_priv), GFP_KERNEL); Loading @@ -1993,9 +2000,20 @@ static int tx_macro_probe(struct platform_device *pdev) return ret; } dev_set_drvdata(&pdev->dev, tx_priv); if (of_find_property(pdev->dev.of_node, is_used_tx_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_tx_swr_gpio_dt, &is_used_tx_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_tx_swr_gpio_dt); is_used_tx_swr_gpio = 1; } } tx_priv->tx_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,tx-swr-gpios", 0); if (!tx_priv->tx_swr_gpio_p) { if (!tx_priv->tx_swr_gpio_p && is_used_tx_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading Loading @@ -2064,6 +2082,7 @@ static int tx_macro_remove(struct platform_device *pdev) if (!tx_priv) return -EINVAL; if (tx_priv->swr_ctrl_data) kfree(tx_priv->swr_ctrl_data); for (count = 0; count < tx_priv->child_count && count < TX_MACRO_CHILD_DEVICES_MAX; count++) Loading
asoc/codecs/bolero/wsa-macro.c +42 −22 Original line number Diff line number Diff line Loading @@ -473,6 +473,7 @@ static int wsa_macro_set_port_map(struct snd_soc_component *component, port_cfg.size = size; port_cfg.params = data; if (wsa_priv->swr_ctrl_data) ret = swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_PORT_MAP, &port_cfg); Loading Loading @@ -910,16 +911,19 @@ static int wsa_macro_event_handler(struct snd_soc_component *component, switch (event) { case BOLERO_MACRO_EVT_SSR_DOWN: if (wsa_priv->swr_ctrl_data) { swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_DOWN, NULL); swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */ wsa_priv->reset_swr = true; if (wsa_priv->swr_ctrl_data) swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_SSR_UP, NULL); Loading Loading @@ -1135,12 +1139,14 @@ static int wsa_macro_enable_swr(struct snd_soc_dapm_widget *w, wsa_priv->rx_1_count++; ch_cnt = wsa_priv->rx_0_count + wsa_priv->rx_1_count; if (wsa_priv->swr_ctrl_data) { swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_UP, NULL); swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_NUM_RX_CH, &ch_cnt); } break; case SND_SOC_DAPM_POST_PMD: if (!(strnstr(w->name, "RX0", sizeof("WSA_RX0"))) && Loading @@ -1151,6 +1157,7 @@ static int wsa_macro_enable_swr(struct snd_soc_dapm_widget *w, wsa_priv->rx_1_count--; ch_cnt = wsa_priv->rx_0_count + wsa_priv->rx_1_count; if (wsa_priv->swr_ctrl_data) swrm_wcd_notify( wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_SET_NUM_RX_CH, &ch_cnt); Loading Loading @@ -2880,6 +2887,8 @@ static int wsa_macro_probe(struct platform_device *pdev) char __iomem *wsa_io_base; int ret = 0; u8 bcl_pmic_params[3]; u32 is_used_wsa_swr_gpio = 1; const char *is_used_wsa_swr_gpio_dt = "qcom,is-used-swr-gpio"; wsa_priv = devm_kzalloc(&pdev->dev, sizeof(struct wsa_macro_priv), GFP_KERNEL); Loading @@ -2894,9 +2903,20 @@ static int wsa_macro_probe(struct platform_device *pdev) __func__, "reg"); return ret; } if (of_find_property(pdev->dev.of_node, is_used_wsa_swr_gpio_dt, NULL)) { ret = of_property_read_u32(pdev->dev.of_node, is_used_wsa_swr_gpio_dt, &is_used_wsa_swr_gpio); if (ret) { dev_err(&pdev->dev, "%s: error reading %s in dt\n", __func__, is_used_wsa_swr_gpio_dt); is_used_wsa_swr_gpio = 1; } } wsa_priv->wsa_swr_gpio_p = of_parse_phandle(pdev->dev.of_node, "qcom,wsa-swr-gpios", 0); if (!wsa_priv->wsa_swr_gpio_p) { if (!wsa_priv->wsa_swr_gpio_p && is_used_wsa_swr_gpio) { dev_err(&pdev->dev, "%s: swr_gpios handle not provided!\n", __func__); return -EINVAL; Loading