Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: msm8916-wcd-analog: Cleanup DT bindings

Merge series from Stephan Gerhold <stephan@gerhold.net>:

Drop the redundant reg-names and mclk from the PM8916 analog codec.
Having the mclk on the analog codec is incorrect because only the
digital codec consumes it directly.

+61 -94
+46 -53
Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml
··· 19 19 reg: 20 20 maxItems: 1 21 21 22 - reg-names: 23 - items: 24 - - const: pmic-codec-core 25 - 26 - clocks: 27 - maxItems: 1 28 - 29 - clock-names: 30 - items: 31 - - const: mclk 32 - 33 22 interrupts: 34 23 maxItems: 14 35 24 ··· 102 113 103 114 examples: 104 115 - | 105 - #include <dt-bindings/clock/qcom,gcc-msm8916.h> 106 116 #include <dt-bindings/interrupt-controller/irq.h> 117 + #include <dt-bindings/spmi/spmi.h> 107 118 108 - audio-codec@f000{ 109 - compatible = "qcom,pm8916-wcd-analog-codec"; 110 - reg = <0xf000 0x200>; 111 - reg-names = "pmic-codec-core"; 112 - clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>; 113 - clock-names = "mclk"; 114 - qcom,mbhc-vthreshold-low = <75 150 237 450 500>; 115 - qcom,mbhc-vthreshold-high = <75 150 237 450 500>; 116 - interrupt-parent = <&spmi_bus>; 117 - interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>, 118 - <0x1 0xf0 0x1 IRQ_TYPE_NONE>, 119 - <0x1 0xf0 0x2 IRQ_TYPE_NONE>, 120 - <0x1 0xf0 0x3 IRQ_TYPE_NONE>, 121 - <0x1 0xf0 0x4 IRQ_TYPE_NONE>, 122 - <0x1 0xf0 0x5 IRQ_TYPE_NONE>, 123 - <0x1 0xf0 0x6 IRQ_TYPE_NONE>, 124 - <0x1 0xf0 0x7 IRQ_TYPE_NONE>, 125 - <0x1 0xf1 0x0 IRQ_TYPE_NONE>, 126 - <0x1 0xf1 0x1 IRQ_TYPE_NONE>, 127 - <0x1 0xf1 0x2 IRQ_TYPE_NONE>, 128 - <0x1 0xf1 0x3 IRQ_TYPE_NONE>, 129 - <0x1 0xf1 0x4 IRQ_TYPE_NONE>, 130 - <0x1 0xf1 0x5 IRQ_TYPE_NONE>; 131 - interrupt-names = "cdc_spk_cnp_int", 132 - "cdc_spk_clip_int", 133 - "cdc_spk_ocp_int", 134 - "mbhc_ins_rem_det1", 135 - "mbhc_but_rel_det", 136 - "mbhc_but_press_det", 137 - "mbhc_ins_rem_det", 138 - "mbhc_switch_int", 139 - "cdc_ear_ocp_int", 140 - "cdc_hphr_ocp_int", 141 - "cdc_hphl_ocp_det", 142 - "cdc_ear_cnp_int", 143 - "cdc_hphr_cnp_int", 144 - "cdc_hphl_cnp_int"; 145 - vdd-cdc-io-supply = <&pm8916_l5>; 146 - vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>; 147 - vdd-micbias-supply = <&pm8916_l13>; 148 - #sound-dai-cells = <1>; 119 + pmic@1 { 120 + compatible = "qcom,pm8916", "qcom,spmi-pmic"; 121 + reg = <0x1 SPMI_USID>; 122 + #address-cells = <1>; 123 + #size-cells = <0>; 124 + 125 + audio-codec@f000 { 126 + compatible = "qcom,pm8916-wcd-analog-codec"; 127 + reg = <0xf000>; 128 + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; 129 + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; 130 + interrupt-parent = <&spmi_bus>; 131 + interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>, 132 + <0x1 0xf0 0x1 IRQ_TYPE_NONE>, 133 + <0x1 0xf0 0x2 IRQ_TYPE_NONE>, 134 + <0x1 0xf0 0x3 IRQ_TYPE_NONE>, 135 + <0x1 0xf0 0x4 IRQ_TYPE_NONE>, 136 + <0x1 0xf0 0x5 IRQ_TYPE_NONE>, 137 + <0x1 0xf0 0x6 IRQ_TYPE_NONE>, 138 + <0x1 0xf0 0x7 IRQ_TYPE_NONE>, 139 + <0x1 0xf1 0x0 IRQ_TYPE_NONE>, 140 + <0x1 0xf1 0x1 IRQ_TYPE_NONE>, 141 + <0x1 0xf1 0x2 IRQ_TYPE_NONE>, 142 + <0x1 0xf1 0x3 IRQ_TYPE_NONE>, 143 + <0x1 0xf1 0x4 IRQ_TYPE_NONE>, 144 + <0x1 0xf1 0x5 IRQ_TYPE_NONE>; 145 + interrupt-names = "cdc_spk_cnp_int", 146 + "cdc_spk_clip_int", 147 + "cdc_spk_ocp_int", 148 + "mbhc_ins_rem_det1", 149 + "mbhc_but_rel_det", 150 + "mbhc_but_press_det", 151 + "mbhc_ins_rem_det", 152 + "mbhc_switch_int", 153 + "cdc_ear_ocp_int", 154 + "cdc_hphr_ocp_int", 155 + "cdc_hphl_ocp_det", 156 + "cdc_ear_cnp_int", 157 + "cdc_hphr_cnp_int", 158 + "cdc_hphl_cnp_int"; 159 + vdd-cdc-io-supply = <&pm8916_l5>; 160 + vdd-cdc-tx-rx-cx-supply = <&pm8916_l5>; 161 + vdd-micbias-supply = <&pm8916_l13>; 162 + #sound-dai-cells = <1>; 163 + }; 149 164 };
+15 -41
sound/soc/codecs/msm8916-wcd-analog.c
··· 7 7 #include <linux/delay.h> 8 8 #include <linux/regulator/consumer.h> 9 9 #include <linux/types.h> 10 - #include <linux/clk.h> 11 10 #include <linux/of.h> 12 11 #include <linux/platform_device.h> 13 12 #include <linux/regmap.h> ··· 1197 1198 if (ret < 0) 1198 1199 return ret; 1199 1200 1200 - priv->mclk = devm_clk_get(dev, "mclk"); 1201 - if (IS_ERR(priv->mclk)) { 1202 - dev_err(dev, "failed to get mclk\n"); 1203 - return PTR_ERR(priv->mclk); 1204 - } 1205 - 1206 1201 for (i = 0; i < ARRAY_SIZE(supply_names); i++) 1207 1202 priv->supplies[i].supply = supply_names[i]; 1208 1203 ··· 1207 1214 return ret; 1208 1215 } 1209 1216 1210 - ret = clk_prepare_enable(priv->mclk); 1211 - if (ret < 0) { 1212 - dev_err(dev, "failed to enable mclk %d\n", ret); 1213 - return ret; 1214 - } 1215 - 1216 1217 irq = platform_get_irq_byname(pdev, "mbhc_switch_int"); 1217 - if (irq < 0) { 1218 - ret = irq; 1219 - goto err_disable_clk; 1220 - } 1218 + if (irq < 0) 1219 + return irq; 1221 1220 1222 1221 ret = devm_request_threaded_irq(dev, irq, NULL, 1223 1222 pm8916_mbhc_switch_irq_handler, 1224 1223 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | 1225 1224 IRQF_ONESHOT, 1226 1225 "mbhc switch irq", priv); 1227 - if (ret) 1226 + if (ret) { 1228 1227 dev_err(dev, "cannot request mbhc switch irq\n"); 1228 + return ret; 1229 + } 1229 1230 1230 1231 if (priv->mbhc_btn_enabled) { 1231 1232 irq = platform_get_irq_byname(pdev, "mbhc_but_press_det"); 1232 - if (irq < 0) { 1233 - ret = irq; 1234 - goto err_disable_clk; 1235 - } 1233 + if (irq < 0) 1234 + return irq; 1236 1235 1237 1236 ret = devm_request_threaded_irq(dev, irq, NULL, 1238 1237 mbhc_btn_press_irq_handler, 1239 1238 IRQF_TRIGGER_RISING | 1240 1239 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1241 1240 "mbhc btn press irq", priv); 1242 - if (ret) 1241 + if (ret) { 1243 1242 dev_err(dev, "cannot request mbhc button press irq\n"); 1243 + return ret; 1244 + } 1244 1245 1245 1246 irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det"); 1246 - if (irq < 0) { 1247 - ret = irq; 1248 - goto err_disable_clk; 1249 - } 1247 + if (irq < 0) 1248 + return irq; 1250 1249 1251 1250 ret = devm_request_threaded_irq(dev, irq, NULL, 1252 1251 mbhc_btn_release_irq_handler, 1253 1252 IRQF_TRIGGER_RISING | 1254 1253 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1255 1254 "mbhc btn release irq", priv); 1256 - if (ret) 1255 + if (ret) { 1257 1256 dev_err(dev, "cannot request mbhc button release irq\n"); 1258 - 1257 + return ret; 1258 + } 1259 1259 } 1260 1260 1261 1261 dev_set_drvdata(dev, priv); ··· 1256 1270 return devm_snd_soc_register_component(dev, &pm8916_wcd_analog, 1257 1271 pm8916_wcd_analog_dai, 1258 1272 ARRAY_SIZE(pm8916_wcd_analog_dai)); 1259 - 1260 - err_disable_clk: 1261 - clk_disable_unprepare(priv->mclk); 1262 - return ret; 1263 - } 1264 - 1265 - static void pm8916_wcd_analog_spmi_remove(struct platform_device *pdev) 1266 - { 1267 - struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(&pdev->dev); 1268 - 1269 - clk_disable_unprepare(priv->mclk); 1270 1273 } 1271 1274 1272 1275 static const struct of_device_id pm8916_wcd_analog_spmi_match_table[] = { ··· 1271 1296 .of_match_table = pm8916_wcd_analog_spmi_match_table, 1272 1297 }, 1273 1298 .probe = pm8916_wcd_analog_spmi_probe, 1274 - .remove_new = pm8916_wcd_analog_spmi_remove, 1275 1299 }; 1276 1300 1277 1301 module_platform_driver(pm8916_wcd_analog_spmi_driver);