Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342660
b: refs/heads/master
c: 77d19b1
h: refs/heads/master
v: v3
  • Loading branch information
Sachin Kamat authored and Mark Brown committed Nov 28, 2012
1 parent f218c78 commit f020edb
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 1,550 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c1c73376b0df5f19dac40cfbaa50f10404ad81b
refs/heads/master: 77d19b10a45504af3810681d33b9ebfdb3a57a35
22 changes: 0 additions & 22 deletions trunk/Documentation/devicetree/bindings/sound/ak4104.txt

This file was deleted.

5 changes: 0 additions & 5 deletions trunk/sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ config SND_SOC_WM_HUBS
default y if SND_SOC_WM8993=y || SND_SOC_WM8994=y
default m if SND_SOC_WM8993=m || SND_SOC_WM8994=m

config SND_SOC_WM_ADSP
tristate
default y if SND_SOC_WM2200=y
default m if SND_SOC_WM2200=m

config SND_SOC_AB8500_CODEC
tristate

Expand Down
2 changes: 0 additions & 2 deletions trunk/sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ snd-soc-twl6040-objs := twl6040.o
snd-soc-uda134x-objs := uda134x.o
snd-soc-uda1380-objs := uda1380.o
snd-soc-wl1273-objs := wl1273.o
snd-soc-wm-adsp-objs := wm_adsp.o
snd-soc-wm0010-objs := wm0010.o
snd-soc-wm1250-ev1-objs := wm1250-ev1.o
snd-soc-wm2000-objs := wm2000.o
Expand Down Expand Up @@ -230,7 +229,6 @@ obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o
obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o
obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o
obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
obj-$(CONFIG_SND_SOC_WM_ADSP) += snd-soc-wm-adsp.o
obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o

# Amp
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/ab8500-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@ static int ab8500_codec_set_dai_tdm_slot(struct snd_soc_dai *dai,
return 0;
}

static struct snd_soc_dai_driver ab8500_codec_dai[] = {
struct snd_soc_dai_driver ab8500_codec_dai[] = {
{
.name = "ab8500-codec-dai.0",
.id = 0,
Expand Down
65 changes: 17 additions & 48 deletions trunk/sound/soc/codecs/ak4104.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <sound/soc.h>
#include <sound/initval.h>
#include <linux/spi/spi.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <sound/asoundef.h>

/* AK4104 registers addresses */
Expand Down Expand Up @@ -100,32 +98,14 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
val = 0;

switch (params_rate(params)) {
case 22050:
val |= IEC958_AES3_CON_FS_22050;
break;
case 24000:
val |= IEC958_AES3_CON_FS_24000;
break;
case 32000:
val |= IEC958_AES3_CON_FS_32000;
break;
case 44100:
val |= IEC958_AES3_CON_FS_44100;
break;
case 48000:
val |= IEC958_AES3_CON_FS_48000;
break;
case 88200:
val |= IEC958_AES3_CON_FS_88200;
break;
case 96000:
val |= IEC958_AES3_CON_FS_96000;
break;
case 176400:
val |= IEC958_AES3_CON_FS_176400;
break;
case 192000:
val |= IEC958_AES3_CON_FS_192000;
case 32000:
val |= IEC958_AES3_CON_FS_32000;
break;
default:
dev_err(codec->dev, "unsupported sampling rate\n");
Expand Down Expand Up @@ -206,7 +186,6 @@ static const struct regmap_config ak4104_regmap = {

static int ak4104_spi_probe(struct spi_device *spi)
{
struct device_node *np = spi->dev.of_node;
struct ak4104_private *ak4104;
unsigned int val;
int ret;
Expand All @@ -222,59 +201,49 @@ static int ak4104_spi_probe(struct spi_device *spi)
if (ak4104 == NULL)
return -ENOMEM;

ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap);
ak4104->regmap = regmap_init_spi(spi, &ak4104_regmap);
if (IS_ERR(ak4104->regmap)) {
ret = PTR_ERR(ak4104->regmap);
return ret;
}

if (np) {
enum of_gpio_flags flags;
int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags);

if (gpio_is_valid(gpio)) {
ret = devm_gpio_request_one(&spi->dev, gpio,
flags & OF_GPIO_ACTIVE_LOW ?
GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
"ak4104 reset");
if (ret < 0)
return ret;
}
}

/* read the 'reserved' register - according to the datasheet, it
* should contain 0x5b. Not a good way to verify the presence of
* the device, but there is no hardware ID register. */
ret = regmap_read(ak4104->regmap, AK4104_REG_RESERVED, &val);
if (ret != 0)
return ret;
if (val != AK4104_RESERVED_VAL)
return -ENODEV;
goto err;
if (val != AK4104_RESERVED_VAL) {
ret = -ENODEV;
goto err;
}

spi_set_drvdata(spi, ak4104);

ret = snd_soc_register_codec(&spi->dev,
&soc_codec_device_ak4104, &ak4104_dai, 1);
if (ret != 0)
goto err;

return 0;

err:
regmap_exit(ak4104->regmap);
return ret;
}

static int __devexit ak4104_spi_remove(struct spi_device *spi)
{
struct ak4104_private *ak4101 = spi_get_drvdata(spi);
regmap_exit(ak4101->regmap);
snd_soc_unregister_codec(&spi->dev);
return 0;
}

static const struct of_device_id ak4104_of_match[] = {
{ .compatible = "asahi-kasei,ak4104", },
{ }
};
MODULE_DEVICE_TABLE(of, ak4104_of_match);

static struct spi_driver ak4104_spi_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.of_match_table = ak4104_of_match,
},
.probe = ak4104_spi_probe,
.remove = __devexit_p(ak4104_spi_remove),
Expand Down
7 changes: 1 addition & 6 deletions trunk/sound/soc/codecs/ak4535.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,
if (ak4535 == NULL)
return -ENOMEM;

ak4535->regmap = regmap_init_i2c(i2c, &ak4535_regmap);
ak4535->regmap = devm_regmap_init_i2c(i2c, &ak4535_regmap);
if (IS_ERR(ak4535->regmap)) {
ret = PTR_ERR(ak4535->regmap);
dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
Expand All @@ -458,18 +458,13 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,

ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_ak4535, &ak4535_dai, 1);
if (ret != 0)
regmap_exit(ak4535->regmap);

return ret;
}

static __devexit int ak4535_i2c_remove(struct i2c_client *client)
{
struct ak4535_priv *ak4535 = i2c_get_clientdata(client);

snd_soc_unregister_codec(&client->dev);
regmap_exit(ak4535->regmap);
return 0;
}

Expand Down
Loading

0 comments on commit f020edb

Please sign in to comment.