wm8903 271 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 275 sound/soc/codecs/wm8903.c wm8903->dcs_pending |= 1 << w->shift; wm8903 292 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 297 sound/soc/codecs/wm8903.c if (wm8903->dcs_pending) { wm8903 299 sound/soc/codecs/wm8903.c wm8903->dcs_pending); wm8903 302 sound/soc/codecs/wm8903.c for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) { wm8903 303 sound/soc/codecs/wm8903.c if (!(wm8903->dcs_pending & (1 << i))) wm8903 306 sound/soc/codecs/wm8903.c if (wm8903->dcs_cache[i]) { wm8903 309 sound/soc/codecs/wm8903.c 3 - i, wm8903->dcs_cache[i]); wm8903 312 sound/soc/codecs/wm8903.c wm8903->dcs_cache[i] & 0xff); wm8903 321 sound/soc/codecs/wm8903.c if (wm8903->class_w_users) wm8903 328 sound/soc/codecs/wm8903.c WM8903_DCS_ENA_MASK, wm8903->dcs_pending); wm8903 338 sound/soc/codecs/wm8903.c if (wm8903->class_w_users) wm8903 341 sound/soc/codecs/wm8903.c for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) { wm8903 342 sound/soc/codecs/wm8903.c if (!(wm8903->dcs_pending & (1 << i))) wm8903 349 sound/soc/codecs/wm8903.c wm8903->dcs_cache[i] = val; wm8903 358 sound/soc/codecs/wm8903.c wm8903->dcs_pending = 0; wm8903 374 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 382 sound/soc/codecs/wm8903.c if (wm8903->class_w_users == 0) { wm8903 387 sound/soc/codecs/wm8903.c wm8903->class_w_users++; wm8903 395 sound/soc/codecs/wm8903.c if (wm8903->class_w_users == 1) { wm8903 400 sound/soc/codecs/wm8903.c wm8903->class_w_users--; wm8903 404 sound/soc/codecs/wm8903.c wm8903->class_w_users); wm8903 418 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 424 sound/soc/codecs/wm8903.c if (wm8903->deemph) { wm8903 427 sound/soc/codecs/wm8903.c if (abs(wm8903_deemph[i] - wm8903->fs) < wm8903 428 sound/soc/codecs/wm8903.c abs(wm8903_deemph[best] - wm8903->fs)) wm8903 449 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 451 sound/soc/codecs/wm8903.c ucontrol->value.integer.value[0] = wm8903->deemph; wm8903 460 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 467 sound/soc/codecs/wm8903.c mutex_lock(&wm8903->lock); wm8903 468 sound/soc/codecs/wm8903.c if (wm8903->deemph != deemph) { wm8903 469 sound/soc/codecs/wm8903.c wm8903->deemph = deemph; wm8903 475 sound/soc/codecs/wm8903.c mutex_unlock(&wm8903->lock); wm8903 1216 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 1218 sound/soc/codecs/wm8903.c wm8903->sysclk = freq; wm8903 1443 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 1505 sound/soc/codecs/wm8903.c wm8903->sysclk, fs); wm8903 1512 sound/soc/codecs/wm8903.c best_val = abs((wm8903->sysclk / wm8903 1516 sound/soc/codecs/wm8903.c cur_val = abs((wm8903->sysclk / wm8903 1528 sound/soc/codecs/wm8903.c clk_sys = wm8903->sysclk / 2; wm8903 1531 sound/soc/codecs/wm8903.c clk_sys = wm8903->sysclk; wm8903 1573 sound/soc/codecs/wm8903.c wm8903->fs = params_rate(params); wm8903 1606 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 1613 sound/soc/codecs/wm8903.c wm8903->mic_jack = jack; wm8903 1614 sound/soc/codecs/wm8903.c wm8903->mic_det = det; wm8903 1615 sound/soc/codecs/wm8903.c wm8903->mic_short = shrt; wm8903 1645 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = data; wm8903 1649 sound/soc/codecs/wm8903.c ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_STATUS_1_MASK, wm8903 1652 sound/soc/codecs/wm8903.c dev_err(wm8903->dev, "Failed to read IRQ mask: %d\n", ret); wm8903 1656 sound/soc/codecs/wm8903.c ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_STATUS_1, &int_val); wm8903 1658 sound/soc/codecs/wm8903.c dev_err(wm8903->dev, "Failed to read IRQ status: %d\n", ret); wm8903 1665 sound/soc/codecs/wm8903.c dev_warn(wm8903->dev, "Write sequencer done\n"); wm8903 1675 sound/soc/codecs/wm8903.c mic_report = wm8903->mic_last_report; wm8903 1676 sound/soc/codecs/wm8903.c ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_POLARITY_1, wm8903 1679 sound/soc/codecs/wm8903.c dev_err(wm8903->dev, "Failed to read interrupt polarity: %d\n", wm8903 1686 sound/soc/codecs/wm8903.c trace_snd_soc_jack_irq(dev_name(wm8903->dev)); wm8903 1690 sound/soc/codecs/wm8903.c dev_dbg(wm8903->dev, "Microphone short (pol=%x)\n", int_pol); wm8903 1692 sound/soc/codecs/wm8903.c mic_report ^= wm8903->mic_short; wm8903 1697 sound/soc/codecs/wm8903.c dev_dbg(wm8903->dev, "Microphone detect (pol=%x)\n", int_pol); wm8903 1699 sound/soc/codecs/wm8903.c mic_report ^= wm8903->mic_det; wm8903 1702 sound/soc/codecs/wm8903.c msleep(wm8903->mic_delay); wm8903 1705 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_INTERRUPT_POLARITY_1, wm8903 1708 sound/soc/codecs/wm8903.c snd_soc_jack_report(wm8903->mic_jack, mic_report, wm8903 1709 sound/soc/codecs/wm8903.c wm8903->mic_short | wm8903->mic_det); wm8903 1711 sound/soc/codecs/wm8903.c wm8903->mic_last_report = mic_report; wm8903 1767 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = snd_soc_component_get_drvdata(component); wm8903 1769 sound/soc/codecs/wm8903.c regcache_sync(wm8903->regmap); wm8903 1785 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = gpiochip_get_data(chip); wm8903 1793 sound/soc/codecs/wm8903.c ret = regmap_update_bits(wm8903->regmap, wm8903 1803 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = gpiochip_get_data(chip); wm8903 1806 sound/soc/codecs/wm8903.c regmap_read(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, ®); wm8903 1814 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = gpiochip_get_data(chip); wm8903 1822 sound/soc/codecs/wm8903.c ret = regmap_update_bits(wm8903->regmap, wm8903 1832 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = gpiochip_get_data(chip); wm8903 1834 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, wm8903 1850 sound/soc/codecs/wm8903.c static void wm8903_init_gpio(struct wm8903_priv *wm8903) wm8903 1852 sound/soc/codecs/wm8903.c struct wm8903_platform_data *pdata = wm8903->pdata; wm8903 1855 sound/soc/codecs/wm8903.c wm8903->gpio_chip = wm8903_template_chip; wm8903 1856 sound/soc/codecs/wm8903.c wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; wm8903 1857 sound/soc/codecs/wm8903.c wm8903->gpio_chip.parent = wm8903->dev; wm8903 1860 sound/soc/codecs/wm8903.c wm8903->gpio_chip.base = pdata->gpio_base; wm8903 1862 sound/soc/codecs/wm8903.c wm8903->gpio_chip.base = -1; wm8903 1864 sound/soc/codecs/wm8903.c ret = gpiochip_add_data(&wm8903->gpio_chip, wm8903); wm8903 1866 sound/soc/codecs/wm8903.c dev_err(wm8903->dev, "Failed to add GPIOs: %d\n", ret); wm8903 1869 sound/soc/codecs/wm8903.c static void wm8903_free_gpio(struct wm8903_priv *wm8903) wm8903 1871 sound/soc/codecs/wm8903.c gpiochip_remove(&wm8903->gpio_chip); wm8903 1874 sound/soc/codecs/wm8903.c static void wm8903_init_gpio(struct wm8903_priv *wm8903) wm8903 1878 sound/soc/codecs/wm8903.c static void wm8903_free_gpio(struct wm8903_priv *wm8903) wm8903 1989 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903; wm8903 1995 sound/soc/codecs/wm8903.c wm8903 = devm_kzalloc(&i2c->dev, sizeof(*wm8903), GFP_KERNEL); wm8903 1996 sound/soc/codecs/wm8903.c if (wm8903 == NULL) wm8903 1999 sound/soc/codecs/wm8903.c mutex_init(&wm8903->lock); wm8903 2000 sound/soc/codecs/wm8903.c wm8903->dev = &i2c->dev; wm8903 2002 sound/soc/codecs/wm8903.c wm8903->regmap = devm_regmap_init_i2c(i2c, &wm8903_regmap); wm8903 2003 sound/soc/codecs/wm8903.c if (IS_ERR(wm8903->regmap)) { wm8903 2004 sound/soc/codecs/wm8903.c ret = PTR_ERR(wm8903->regmap); wm8903 2010 sound/soc/codecs/wm8903.c i2c_set_clientdata(i2c, wm8903); wm8903 2014 sound/soc/codecs/wm8903.c wm8903->pdata = pdata; wm8903 2016 sound/soc/codecs/wm8903.c wm8903->pdata = devm_kzalloc(&i2c->dev, sizeof(*wm8903->pdata), wm8903 2018 sound/soc/codecs/wm8903.c if (!wm8903->pdata) wm8903 2022 sound/soc/codecs/wm8903.c ret = wm8903_set_pdata_irq_trigger(i2c, wm8903->pdata); wm8903 2028 sound/soc/codecs/wm8903.c ret = wm8903_set_pdata_from_of(i2c, wm8903->pdata); wm8903 2034 sound/soc/codecs/wm8903.c pdata = wm8903->pdata; wm8903 2036 sound/soc/codecs/wm8903.c for (i = 0; i < ARRAY_SIZE(wm8903->supplies); i++) wm8903 2037 sound/soc/codecs/wm8903.c wm8903->supplies[i].supply = wm8903_supply_names[i]; wm8903 2039 sound/soc/codecs/wm8903.c ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8903->supplies), wm8903 2040 sound/soc/codecs/wm8903.c wm8903->supplies); wm8903 2046 sound/soc/codecs/wm8903.c ret = regulator_bulk_enable(ARRAY_SIZE(wm8903->supplies), wm8903 2047 sound/soc/codecs/wm8903.c wm8903->supplies); wm8903 2053 sound/soc/codecs/wm8903.c ret = regmap_read(wm8903->regmap, WM8903_SW_RESET_AND_ID, &val); wm8903 2064 sound/soc/codecs/wm8903.c ret = regmap_read(wm8903->regmap, WM8903_REVISION_NUMBER, &val); wm8903 2073 sound/soc/codecs/wm8903.c regmap_write(wm8903->regmap, WM8903_SW_RESET_AND_ID, 0x8903); wm8903 2075 sound/soc/codecs/wm8903.c wm8903_init_gpio(wm8903); wm8903 2083 sound/soc/codecs/wm8903.c regmap_write(wm8903->regmap, WM8903_GPIO_CONTROL_1 + i, wm8903 2100 sound/soc/codecs/wm8903.c regmap_write(wm8903->regmap, WM8903_MIC_BIAS_CONTROL_0, wm8903 2105 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_WRITE_SEQUENCER_0, wm8903 2116 sound/soc/codecs/wm8903.c wm8903->mic_delay = pdata->micdet_delay; wm8903 2127 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_INTERRUPT_CONTROL, wm8903 2132 sound/soc/codecs/wm8903.c "wm8903", wm8903); wm8903 2134 sound/soc/codecs/wm8903.c dev_err(wm8903->dev, "Failed to request IRQ: %d\n", wm8903 2140 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, wm8903 2146 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ADC_DIGITAL_VOLUME_LEFT, wm8903 2148 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ADC_DIGITAL_VOLUME_RIGHT, wm8903 2151 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_VOLUME_LEFT, wm8903 2153 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_VOLUME_RIGHT, wm8903 2156 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT1_LEFT, wm8903 2158 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT1_RIGHT, wm8903 2161 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT2_LEFT, wm8903 2163 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT2_RIGHT, wm8903 2166 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT3_LEFT, wm8903 2168 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT3_RIGHT, wm8903 2172 sound/soc/codecs/wm8903.c regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_1, wm8903 2183 sound/soc/codecs/wm8903.c regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies), wm8903 2184 sound/soc/codecs/wm8903.c wm8903->supplies); wm8903 2190 sound/soc/codecs/wm8903.c struct wm8903_priv *wm8903 = i2c_get_clientdata(client); wm8903 2192 sound/soc/codecs/wm8903.c regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies), wm8903 2193 sound/soc/codecs/wm8903.c wm8903->supplies); wm8903 2195 sound/soc/codecs/wm8903.c free_irq(client->irq, wm8903); wm8903 2196 sound/soc/codecs/wm8903.c wm8903_free_gpio(wm8903);