switch (madera->type) {
case CS47L35:
+ case CS47L92:
+ case CS47L93:
/*
* check whether audio is routed to EPOUT, do not disable OUT1
* in that case
*/
regmap_read(madera->regmap, MADERA_OUTPUT_ENABLES_1, &ep_sel);
ep_sel &= MADERA_EP_SEL_MASK;
- /* fall through to next step to set common variables */
+ break;
+ default:
+ break;
+ };
+
+ switch (madera->type) {
+ case CS47L35:
case CS47L85:
case WM1840:
edre_reg = MADERA_EDRE_MANUAL;
if (clamp && !ep_sel) {
ret = regmap_update_bits(madera->regmap,
MADERA_OUTPUT_ENABLES_1,
- MADERA_OUT1L_ENA |
- MADERA_OUT1R_ENA, 0);
+ (MADERA_OUT1L_ENA |
+ MADERA_OUT1R_ENA) <<
+ (2 * (info->pdata->output - 1)),
+ 0);
if (ret)
dev_warn(info->dev,
"Failed to disable headphone outputs: %d\n",
info->pdata->hpdet_short_circuit_imp) && !ep_sel) {
ret = regmap_update_bits(madera->regmap,
MADERA_OUTPUT_ENABLES_1,
- MADERA_OUT1L_ENA | MADERA_OUT1R_ENA,
+ (MADERA_OUT1L_ENA |
+ MADERA_OUT1R_ENA) <<
+ (2 * (info->pdata->output - 1)),
madera->hp_ena);
if (ret)
dev_warn(info->dev,
info->micd_modes[mode].gnd <<
MADERA_HPD_GND_SEL_SHIFT);
regmap_update_bits(madera->regmap,
- MADERA_OUTPUT_PATH_CONFIG_1,
+ MADERA_OUTPUT_PATH_CONFIG_1 +
+ (8 * (info->pdata->output - 1)),
MADERA_HP1_GND_SEL_MASK,
info->micd_modes[mode].hp_gnd <<
MADERA_HP1_GND_SEL_SHIFT);
data.present = present;
data.impedance_x100 = madera_ohm_to_hohm(impedance);
- data.out_num = 1;
+ data.out_num = info->pdata->output;
madera_call_notifiers(info->madera, MADERA_NOTIFY_MICDET, &data);
}
for (i = 0; i < ARRAY_SIZE(info->madera->pdata.accdet); ++i) {
pdata = &info->madera->pdata.accdet[i];
- dev_dbg(info->dev, "extcon pdata OUT%u\n", i + 1);
+ dev_dbg(info->dev, "extcon pdata OUT%u\n", pdata->output);
MADERA_EXTCON_PDATA_DUMP(enabled, "%u");
MADERA_EXTCON_PDATA_DUMP(jd_wake_time, "%d");
MADERA_EXTCON_PDATA_DUMP(jd_use_jd2, "%u");
return ret;
}
- if (!pdata->enabled || pdata->output == 0) {
+ if (!pdata->enabled || pdata->output == 0)
return -ENODEV; /* no accdet output configured */
- } else if (pdata->output != 1) {
- dev_err(info->dev, "Only OUT1 is supported, OUT%d requested\n",
- pdata->output);
- return -ENODEV;
- }
if (pdata->hpdet_short_circuit_imp < MADERA_HP_SHORT_IMPEDANCE_MIN)
pdata->hpdet_short_circuit_imp = MADERA_HP_SHORT_IMPEDANCE_MIN;