Lines Matching refs:aic32x4
800 struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component); in aic32x4_hw_params() local
832 if (aic32x4->swapdacs) in aic32x4_hw_params()
924 struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component); in aic32x4_setup_gpios() local
928 if (aic32x4->setup->gpio_func[0] != AIC32X4_MFPX_DEFAULT_VALUE) { in aic32x4_setup_gpios()
930 aic32x4->setup->gpio_func[0]); in aic32x4_setup_gpios()
936 if (aic32x4->setup->gpio_func[1] != AIC32X4_MFPX_DEFAULT_VALUE) { in aic32x4_setup_gpios()
938 aic32x4->setup->gpio_func[1]); in aic32x4_setup_gpios()
944 if (aic32x4->setup->gpio_func[2] != AIC32X4_MFPX_DEFAULT_VALUE) { in aic32x4_setup_gpios()
946 aic32x4->setup->gpio_func[2]); in aic32x4_setup_gpios()
952 if (aic32x4->setup->gpio_func[3] != AIC32X4_MFPX_DEFAULT_VALUE) { in aic32x4_setup_gpios()
954 aic32x4->setup->gpio_func[3]); in aic32x4_setup_gpios()
960 if (aic32x4->setup->gpio_func[4] != AIC32X4_MFPX_DEFAULT_VALUE) { in aic32x4_setup_gpios()
962 aic32x4->setup->gpio_func[4]); in aic32x4_setup_gpios()
970 struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component); in aic32x4_component_probe() local
985 if (aic32x4->setup) in aic32x4_component_probe()
992 if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) { in aic32x4_component_probe()
996 if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) in aic32x4_component_probe()
999 tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ? in aic32x4_component_probe()
1004 if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) in aic32x4_component_probe()
1006 if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED) in aic32x4_component_probe()
1011 if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K) in aic32x4_component_probe()
1017 if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K) in aic32x4_component_probe()
1061 static int aic32x4_parse_dt(struct aic32x4_priv *aic32x4, in aic32x4_parse_dt() argument
1067 aic32x4_setup = devm_kzalloc(aic32x4->dev, sizeof(*aic32x4_setup), in aic32x4_parse_dt()
1075 aic32x4->mclk_name = of_clk_get_parent_name(np, ret); in aic32x4_parse_dt()
1077 aic32x4->swapdacs = false; in aic32x4_parse_dt()
1078 aic32x4->micpga_routing = 0; in aic32x4_parse_dt()
1079 aic32x4->rstn_gpio = of_get_named_gpio(np, "reset-gpios", 0); in aic32x4_parse_dt()
1083 aic32x4->setup = aic32x4_setup; in aic32x4_parse_dt()
1087 static void aic32x4_disable_regulators(struct aic32x4_priv *aic32x4) in aic32x4_disable_regulators() argument
1089 regulator_disable(aic32x4->supply_iov); in aic32x4_disable_regulators()
1091 if (!IS_ERR(aic32x4->supply_ldo)) in aic32x4_disable_regulators()
1092 regulator_disable(aic32x4->supply_ldo); in aic32x4_disable_regulators()
1094 if (!IS_ERR(aic32x4->supply_dv)) in aic32x4_disable_regulators()
1095 regulator_disable(aic32x4->supply_dv); in aic32x4_disable_regulators()
1097 if (!IS_ERR(aic32x4->supply_av)) in aic32x4_disable_regulators()
1098 regulator_disable(aic32x4->supply_av); in aic32x4_disable_regulators()
1102 struct aic32x4_priv *aic32x4) in aic32x4_setup_regulators() argument
1106 aic32x4->supply_ldo = devm_regulator_get_optional(dev, "ldoin"); in aic32x4_setup_regulators()
1107 aic32x4->supply_iov = devm_regulator_get(dev, "iov"); in aic32x4_setup_regulators()
1108 aic32x4->supply_dv = devm_regulator_get_optional(dev, "dv"); in aic32x4_setup_regulators()
1109 aic32x4->supply_av = devm_regulator_get_optional(dev, "av"); in aic32x4_setup_regulators()
1113 if (IS_ERR(aic32x4->supply_iov)) { in aic32x4_setup_regulators()
1115 return PTR_ERR(aic32x4->supply_iov); in aic32x4_setup_regulators()
1118 if (IS_ERR(aic32x4->supply_ldo)) { in aic32x4_setup_regulators()
1119 if (PTR_ERR(aic32x4->supply_ldo) == -EPROBE_DEFER) in aic32x4_setup_regulators()
1122 if (IS_ERR(aic32x4->supply_dv)) { in aic32x4_setup_regulators()
1124 return PTR_ERR(aic32x4->supply_dv); in aic32x4_setup_regulators()
1126 if (IS_ERR(aic32x4->supply_av)) { in aic32x4_setup_regulators()
1128 return PTR_ERR(aic32x4->supply_av); in aic32x4_setup_regulators()
1131 if (PTR_ERR(aic32x4->supply_dv) == -EPROBE_DEFER) in aic32x4_setup_regulators()
1133 if (PTR_ERR(aic32x4->supply_av) == -EPROBE_DEFER) in aic32x4_setup_regulators()
1137 ret = regulator_enable(aic32x4->supply_iov); in aic32x4_setup_regulators()
1143 if (!IS_ERR(aic32x4->supply_ldo)) { in aic32x4_setup_regulators()
1144 ret = regulator_enable(aic32x4->supply_ldo); in aic32x4_setup_regulators()
1151 if (!IS_ERR(aic32x4->supply_dv)) { in aic32x4_setup_regulators()
1152 ret = regulator_enable(aic32x4->supply_dv); in aic32x4_setup_regulators()
1159 if (!IS_ERR(aic32x4->supply_av)) { in aic32x4_setup_regulators()
1160 ret = regulator_enable(aic32x4->supply_av); in aic32x4_setup_regulators()
1167 if (!IS_ERR(aic32x4->supply_ldo) && IS_ERR(aic32x4->supply_av)) in aic32x4_setup_regulators()
1168 aic32x4->power_cfg |= AIC32X4_PWR_AIC32X4_LDO_ENABLE; in aic32x4_setup_regulators()
1173 if (!IS_ERR(aic32x4->supply_dv)) in aic32x4_setup_regulators()
1174 regulator_disable(aic32x4->supply_dv); in aic32x4_setup_regulators()
1177 if (!IS_ERR(aic32x4->supply_ldo)) in aic32x4_setup_regulators()
1178 regulator_disable(aic32x4->supply_ldo); in aic32x4_setup_regulators()
1181 regulator_disable(aic32x4->supply_iov); in aic32x4_setup_regulators()
1187 struct aic32x4_priv *aic32x4; in aic32x4_probe() local
1195 aic32x4 = devm_kzalloc(dev, sizeof(struct aic32x4_priv), in aic32x4_probe()
1197 if (aic32x4 == NULL) in aic32x4_probe()
1200 aic32x4->dev = dev; in aic32x4_probe()
1201 dev_set_drvdata(dev, aic32x4); in aic32x4_probe()
1204 aic32x4->power_cfg = pdata->power_cfg; in aic32x4_probe()
1205 aic32x4->swapdacs = pdata->swapdacs; in aic32x4_probe()
1206 aic32x4->micpga_routing = pdata->micpga_routing; in aic32x4_probe()
1207 aic32x4->rstn_gpio = pdata->rstn_gpio; in aic32x4_probe()
1208 aic32x4->mclk_name = "mclk"; in aic32x4_probe()
1210 ret = aic32x4_parse_dt(aic32x4, np); in aic32x4_probe()
1216 aic32x4->power_cfg = 0; in aic32x4_probe()
1217 aic32x4->swapdacs = false; in aic32x4_probe()
1218 aic32x4->micpga_routing = 0; in aic32x4_probe()
1219 aic32x4->rstn_gpio = -1; in aic32x4_probe()
1220 aic32x4->mclk_name = "mclk"; in aic32x4_probe()
1223 if (gpio_is_valid(aic32x4->rstn_gpio)) { in aic32x4_probe()
1224 ret = devm_gpio_request_one(dev, aic32x4->rstn_gpio, in aic32x4_probe()
1230 ret = aic32x4_setup_regulators(dev, aic32x4); in aic32x4_probe()
1236 if (gpio_is_valid(aic32x4->rstn_gpio)) { in aic32x4_probe()
1238 gpio_set_value_cansleep(aic32x4->rstn_gpio, 1); in aic32x4_probe()
1246 ret = aic32x4_register_clocks(dev, aic32x4->mclk_name); in aic32x4_probe()
1260 aic32x4_disable_regulators(aic32x4); in aic32x4_probe()
1268 struct aic32x4_priv *aic32x4 = dev_get_drvdata(dev); in aic32x4_remove() local
1270 aic32x4_disable_regulators(aic32x4); in aic32x4_remove()