Commit f11aec0d authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/rt5659', 'asoc/fix/sigmadsp',...

Merge remote-tracking branches 'asoc/fix/rt5659', 'asoc/fix/sigmadsp', 'asoc/fix/simple', 'asoc/fix/wm5110' and 'asoc/fix/wm8960' into asoc-linus
...@@ -3985,7 +3985,6 @@ static int rt5659_i2c_probe(struct i2c_client *i2c, ...@@ -3985,7 +3985,6 @@ static int rt5659_i2c_probe(struct i2c_client *i2c,
if (rt5659 == NULL) if (rt5659 == NULL)
return -ENOMEM; return -ENOMEM;
rt5659->i2c = i2c;
i2c_set_clientdata(i2c, rt5659); i2c_set_clientdata(i2c, rt5659);
if (pdata) if (pdata)
...@@ -4157,24 +4156,17 @@ static int rt5659_i2c_probe(struct i2c_client *i2c, ...@@ -4157,24 +4156,17 @@ static int rt5659_i2c_probe(struct i2c_client *i2c,
INIT_DELAYED_WORK(&rt5659->jack_detect_work, rt5659_jack_detect_work); INIT_DELAYED_WORK(&rt5659->jack_detect_work, rt5659_jack_detect_work);
if (rt5659->i2c->irq) { if (i2c->irq) {
ret = request_threaded_irq(rt5659->i2c->irq, NULL, rt5659_irq, ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING rt5659_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
| IRQF_ONESHOT, "rt5659", rt5659); | IRQF_ONESHOT, "rt5659", rt5659);
if (ret) if (ret)
dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret); dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
} }
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659, return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659,
rt5659_dai, ARRAY_SIZE(rt5659_dai)); rt5659_dai, ARRAY_SIZE(rt5659_dai));
if (ret) {
if (rt5659->i2c->irq)
free_irq(rt5659->i2c->irq, rt5659);
}
return 0;
} }
static int rt5659_i2c_remove(struct i2c_client *i2c) static int rt5659_i2c_remove(struct i2c_client *i2c)
...@@ -4191,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client) ...@@ -4191,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client)
regmap_write(rt5659->regmap, RT5659_RESET, 0); regmap_write(rt5659->regmap, RT5659_RESET, 0);
} }
#ifdef CONFIG_OF
static const struct of_device_id rt5659_of_match[] = { static const struct of_device_id rt5659_of_match[] = {
{ .compatible = "realtek,rt5658", }, { .compatible = "realtek,rt5658", },
{ .compatible = "realtek,rt5659", }, { .compatible = "realtek,rt5659", },
{}, { },
}; };
MODULE_DEVICE_TABLE(of, rt5659_of_match);
#endif
#ifdef CONFIG_ACPI
static struct acpi_device_id rt5659_acpi_match[] = { static struct acpi_device_id rt5659_acpi_match[] = {
{ "10EC5658", 0}, { "10EC5658", 0, },
{ "10EC5659", 0}, { "10EC5659", 0, },
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match); MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match);
#endif
struct i2c_driver rt5659_i2c_driver = { struct i2c_driver rt5659_i2c_driver = {
.driver = { .driver = {
.name = "rt5659", .name = "rt5659",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = rt5659_of_match, .of_match_table = of_match_ptr(rt5659_of_match),
.acpi_match_table = ACPI_PTR(rt5659_acpi_match), .acpi_match_table = ACPI_PTR(rt5659_acpi_match),
}, },
.probe = rt5659_i2c_probe, .probe = rt5659_i2c_probe,
......
...@@ -1792,7 +1792,6 @@ struct rt5659_priv { ...@@ -1792,7 +1792,6 @@ struct rt5659_priv {
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
struct rt5659_platform_data pdata; struct rt5659_platform_data pdata;
struct regmap *regmap; struct regmap *regmap;
struct i2c_client *i2c;
struct gpio_desc *gpiod_ldo1_en; struct gpio_desc *gpiod_ldo1_en;
struct gpio_desc *gpiod_reset; struct gpio_desc *gpiod_reset;
struct snd_soc_jack *hs_jack; struct snd_soc_jack *hs_jack;
......
...@@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data, ...@@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
kfree(buf); kfree(buf);
return ret; if (ret < 0)
return ret;
return 0;
} }
static int sigmadsp_read_i2c(void *control_data, static int sigmadsp_read_i2c(void *control_data,
......
...@@ -2382,6 +2382,7 @@ static int wm5110_probe(struct platform_device *pdev) ...@@ -2382,6 +2382,7 @@ static int wm5110_probe(struct platform_device *pdev)
static int wm5110_remove(struct platform_device *pdev) static int wm5110_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_platform(&pdev->dev);
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
...@@ -240,13 +240,13 @@ SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL, ...@@ -240,13 +240,13 @@ SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL, SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
7, 1, 1), 7, 1, 1),
SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume", SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume",
WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv), WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume", SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume",
WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv), WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv),
SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume", SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv), WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv),
SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume", SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume",
WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv), WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv),
SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume", SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume",
WM8960_RINPATH, 4, 3, 0, micboost_tlv), WM8960_RINPATH, 4, 3, 0, micboost_tlv),
...@@ -643,29 +643,31 @@ static int wm8960_configure_clocking(struct snd_soc_codec *codec) ...@@ -643,29 +643,31 @@ static int wm8960_configure_clocking(struct snd_soc_codec *codec)
return -EINVAL; return -EINVAL;
} }
/* check if the sysclk frequency is available. */ if (wm8960->clk_id != WM8960_SYSCLK_PLL) {
for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) { /* check if the sysclk frequency is available. */
if (sysclk_divs[i] == -1) for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
continue; if (sysclk_divs[i] == -1)
sysclk = freq_out / sysclk_divs[i]; continue;
for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) { sysclk = freq_out / sysclk_divs[i];
if (sysclk == dac_divs[j] * lrclk) { for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {
if (sysclk != dac_divs[j] * lrclk)
continue;
for (k = 0; k < ARRAY_SIZE(bclk_divs); ++k) for (k = 0; k < ARRAY_SIZE(bclk_divs); ++k)
if (sysclk == bclk * bclk_divs[k] / 10) if (sysclk == bclk * bclk_divs[k] / 10)
break; break;
if (k != ARRAY_SIZE(bclk_divs)) if (k != ARRAY_SIZE(bclk_divs))
break; break;
} }
if (j != ARRAY_SIZE(dac_divs))
break;
} }
if (j != ARRAY_SIZE(dac_divs))
break;
}
if (i != ARRAY_SIZE(sysclk_divs)) { if (i != ARRAY_SIZE(sysclk_divs)) {
goto configure_clock; goto configure_clock;
} else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) { } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) {
dev_err(codec->dev, "failed to configure clock\n"); dev_err(codec->dev, "failed to configure clock\n");
return -EINVAL; return -EINVAL;
}
} }
/* get a available pll out frequency and set pll */ /* get a available pll out frequency and set pll */
for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) { for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
......
...@@ -99,7 +99,7 @@ static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream, ...@@ -99,7 +99,7 @@ static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
if (ret && ret != -ENOTSUPP) if (ret && ret != -ENOTSUPP)
goto err; goto err;
} }
return 0;
err: err:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment