Lines Matching refs:pm860x
3 * 88pm860x-codec.c -- 88PM860x ALSA SoC Audio Driver
13 #include <linux/mfd/88pm860x.h>
26 #include "88pm860x-codec.h"
965 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
975 if (pm860x->dir == PM860X_CLK_DIR_OUT) {
981 if (pm860x->dir == PM860X_CLK_DIR_IN) {
1005 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1008 pm860x->dir = PM860X_CLK_DIR_OUT;
1070 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1078 if (pm860x->dir == PM860X_CLK_DIR_OUT)
1084 if (pm860x->dir == PM860X_CLK_DIR_IN)
1108 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1122 pm860x_reg_write(pm860x->i2c, REG_MISC2, data);
1126 pm860x_reg_write(pm860x->i2c, REG_MISC2, data);
1132 pm860x_set_bits(pm860x->i2c, REG_MISC2, data, 0);
1160 .name = "88pm860x-pcm",
1181 .name = "88pm860x-i2s",
1205 struct pm860x_priv *pm860x = data;
1209 status = pm860x_reg_read(pm860x->i2c, REG_STATUS_1);
1210 shrt = pm860x_reg_read(pm860x->i2c, REG_SHORTS);
1211 mask = pm860x->det.hs_shrt | pm860x->det.hook_det | pm860x->det.lo_shrt
1212 | pm860x->det.hp_det;
1217 trace_snd_soc_jack_irq(dev_name(pm860x->component->dev));
1220 if ((pm860x->det.hp_det & SND_JACK_HEADPHONE)
1224 if ((pm860x->det.mic_det & SND_JACK_MICROPHONE)
1228 if (pm860x->det.hs_shrt && (shrt & (SHORT_HS1 | SHORT_HS2)))
1229 report |= pm860x->det.hs_shrt;
1231 if (pm860x->det.hook_det && (status & HOOK_STATUS))
1232 report |= pm860x->det.hook_det;
1234 if (pm860x->det.lo_shrt && (shrt & (SHORT_LO1 | SHORT_LO2)))
1235 report |= pm860x->det.lo_shrt;
1238 snd_soc_jack_report(pm860x->det.hp_jack, report, mask);
1240 snd_soc_jack_report(pm860x->det.mic_jack, SND_JACK_MICROPHONE,
1243 dev_dbg(pm860x->component->dev, "headphone report:0x%x, mask:%x\n",
1245 dev_dbg(pm860x->component->dev, "microphone report:0x%x\n", mic_report);
1253 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1256 pm860x->det.hp_jack = jack;
1257 pm860x->det.hp_det = det;
1258 pm860x->det.hook_det = hook;
1259 pm860x->det.hs_shrt = hs_shrt;
1260 pm860x->det.lo_shrt = lo_shrt;
1263 pm860x_set_bits(pm860x->i2c, REG_HS_DET,
1268 pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data);
1273 pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data);
1277 pm860x_component_handler(0, pm860x);
1285 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1287 pm860x->det.mic_jack = jack;
1288 pm860x->det.mic_det = det;
1291 pm860x_set_bits(pm860x->i2c, REG_MIC_DET,
1295 pm860x_component_handler(0, pm860x);
1302 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1305 pm860x->component = component;
1306 snd_soc_component_init_regmap(component, pm860x->regmap);
1309 ret = request_threaded_irq(pm860x->irq[i], NULL,
1311 pm860x->name[i], pm860x);
1322 free_irq(pm860x->irq[i], pm860x);
1328 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component);
1332 free_irq(pm860x->irq[i], pm860x);
1354 struct pm860x_priv *pm860x;
1358 pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv),
1360 if (pm860x == NULL)
1363 pm860x->chip = chip;
1364 pm860x->i2c = (chip->id == CHIP_PM8607) ? chip->client
1366 pm860x->regmap = (chip->id == CHIP_PM8607) ? chip->regmap
1368 platform_set_drvdata(pdev, pm860x);
1376 pm860x->irq[i] = res->start + chip->irq_base;
1377 strncpy(pm860x->name[i], res->name, MAX_NAME_LEN);
1397 .name = "88pm860x-codec",
1408 MODULE_ALIAS("platform:88pm860x-codec");