Lines Matching refs:pm860x
965 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_pcm_set_dai_fmt() local
975 if (pm860x->dir == PM860X_CLK_DIR_OUT) { in pm860x_pcm_set_dai_fmt()
981 if (pm860x->dir == PM860X_CLK_DIR_IN) { in pm860x_pcm_set_dai_fmt()
1005 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_set_dai_sysclk() local
1008 pm860x->dir = PM860X_CLK_DIR_OUT; in pm860x_set_dai_sysclk()
1070 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_i2s_set_dai_fmt() local
1078 if (pm860x->dir == PM860X_CLK_DIR_OUT) in pm860x_i2s_set_dai_fmt()
1084 if (pm860x->dir == PM860X_CLK_DIR_IN) in pm860x_i2s_set_dai_fmt()
1108 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_set_bias_level() local
1122 pm860x_reg_write(pm860x->i2c, REG_MISC2, data); in pm860x_set_bias_level()
1126 pm860x_reg_write(pm860x->i2c, REG_MISC2, data); in pm860x_set_bias_level()
1132 pm860x_set_bits(pm860x->i2c, REG_MISC2, data, 0); in pm860x_set_bias_level()
1205 struct pm860x_priv *pm860x = data; in pm860x_component_handler() local
1209 status = pm860x_reg_read(pm860x->i2c, REG_STATUS_1); in pm860x_component_handler()
1210 shrt = pm860x_reg_read(pm860x->i2c, REG_SHORTS); in pm860x_component_handler()
1211 mask = pm860x->det.hs_shrt | pm860x->det.hook_det | pm860x->det.lo_shrt in pm860x_component_handler()
1212 | pm860x->det.hp_det; in pm860x_component_handler()
1217 trace_snd_soc_jack_irq(dev_name(pm860x->component->dev)); in pm860x_component_handler()
1220 if ((pm860x->det.hp_det & SND_JACK_HEADPHONE) in pm860x_component_handler()
1224 if ((pm860x->det.mic_det & SND_JACK_MICROPHONE) in pm860x_component_handler()
1228 if (pm860x->det.hs_shrt && (shrt & (SHORT_HS1 | SHORT_HS2))) in pm860x_component_handler()
1229 report |= pm860x->det.hs_shrt; in pm860x_component_handler()
1231 if (pm860x->det.hook_det && (status & HOOK_STATUS)) in pm860x_component_handler()
1232 report |= pm860x->det.hook_det; in pm860x_component_handler()
1234 if (pm860x->det.lo_shrt && (shrt & (SHORT_LO1 | SHORT_LO2))) in pm860x_component_handler()
1235 report |= pm860x->det.lo_shrt; in pm860x_component_handler()
1238 snd_soc_jack_report(pm860x->det.hp_jack, report, mask); in pm860x_component_handler()
1240 snd_soc_jack_report(pm860x->det.mic_jack, SND_JACK_MICROPHONE, in pm860x_component_handler()
1243 dev_dbg(pm860x->component->dev, "headphone report:0x%x, mask:%x\n", in pm860x_component_handler()
1245 dev_dbg(pm860x->component->dev, "microphone report:0x%x\n", mic_report); in pm860x_component_handler()
1253 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_hs_jack_detect() local
1256 pm860x->det.hp_jack = jack; in pm860x_hs_jack_detect()
1257 pm860x->det.hp_det = det; in pm860x_hs_jack_detect()
1258 pm860x->det.hook_det = hook; in pm860x_hs_jack_detect()
1259 pm860x->det.hs_shrt = hs_shrt; in pm860x_hs_jack_detect()
1260 pm860x->det.lo_shrt = lo_shrt; in pm860x_hs_jack_detect()
1263 pm860x_set_bits(pm860x->i2c, REG_HS_DET, in pm860x_hs_jack_detect()
1268 pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data); in pm860x_hs_jack_detect()
1273 pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data); in pm860x_hs_jack_detect()
1277 pm860x_component_handler(0, pm860x); in pm860x_hs_jack_detect()
1285 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_mic_jack_detect() local
1287 pm860x->det.mic_jack = jack; in pm860x_mic_jack_detect()
1288 pm860x->det.mic_det = det; in pm860x_mic_jack_detect()
1291 pm860x_set_bits(pm860x->i2c, REG_MIC_DET, in pm860x_mic_jack_detect()
1295 pm860x_component_handler(0, pm860x); in pm860x_mic_jack_detect()
1302 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_probe() local
1305 pm860x->component = component; in pm860x_probe()
1306 snd_soc_component_init_regmap(component, pm860x->regmap); in pm860x_probe()
1309 ret = request_threaded_irq(pm860x->irq[i], NULL, in pm860x_probe()
1311 pm860x->name[i], pm860x); in pm860x_probe()
1322 free_irq(pm860x->irq[i], pm860x); in pm860x_probe()
1328 struct pm860x_priv *pm860x = snd_soc_component_get_drvdata(component); in pm860x_remove() local
1332 free_irq(pm860x->irq[i], pm860x); in pm860x_remove()
1353 struct pm860x_priv *pm860x; in pm860x_codec_probe() local
1357 pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv), in pm860x_codec_probe()
1359 if (pm860x == NULL) in pm860x_codec_probe()
1362 pm860x->chip = chip; in pm860x_codec_probe()
1363 pm860x->i2c = (chip->id == CHIP_PM8607) ? chip->client in pm860x_codec_probe()
1365 pm860x->regmap = (chip->id == CHIP_PM8607) ? chip->regmap in pm860x_codec_probe()
1367 platform_set_drvdata(pdev, pm860x); in pm860x_codec_probe()
1375 pm860x->irq[i] = res->start + chip->irq_base; in pm860x_codec_probe()
1376 strscpy(pm860x->name[i], res->name, MAX_NAME_LEN); in pm860x_codec_probe()