Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/sirf'…
Browse files Browse the repository at this point in the history
…, 'asoc/topic/spdif', 'asoc/topic/ssm2602' and 'asoc/topic/ssm4567' into asoc-next
  • Loading branch information
Mark Brown committed Oct 6, 2014
6 parents 7370780 + 872bbb3 + 0d985b1 + 58a9014 + 3b2a001 + 7c168d5 commit 248519c
Show file tree
Hide file tree
Showing 12 changed files with 601 additions and 77 deletions.
19 changes: 19 additions & 0 deletions Documentation/devicetree/bindings/sound/adi,ssm2602.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Analog Devices SSM2602, SSM2603 and SSM2604 I2S audio CODEC devices

SSM2602 support both I2C and SPI as the configuration interface,
the selection is made by the MODE strap-in pin.
SSM2603 and SSM2604 only support I2C as the configuration interface.

Required properties:

- compatible : One of "adi,ssm2602", "adi,ssm2603" or "adi,ssm2604"

- reg : the I2C address of the device for I2C, the chip select
number for SPI.

Example:

ssm2602: ssm2602@1a {
compatible = "adi,ssm2602";
reg = <0x1a>;
};
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/sound/simple-card.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Optional properties:
source.
- simple-audio-card,mclk-fs : Multiplication factor between stream rate and codec
mclk.
- simple-audio-card,hp-det-gpio : Reference to GPIO that signals when
headphones are attached.
- simple-audio-card,mic-det-gpio : Reference to GPIO that signals when
a microphone is attached.

Optional subnodes:

Expand Down
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/sound/ssm4567.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Analog Devices SSM4567 audio amplifier

This device supports I2C only.

Required properties:
- compatible : Must be "adi,ssm4567"
- reg : the I2C address of the device. This will either be 0x34 (LR_SEL/ADDR connected to AGND),
0x35 (LR_SEL/ADDR connected to IOVDD) or 0x36 (LR_SEL/ADDR open).

Example:

ssm4567: ssm4567@34 {
compatible = "adi,ssm4567";
reg = <0x34>;
};
13 changes: 11 additions & 2 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_SSM2518 if I2C
select SND_SOC_SSM2602_SPI if SPI_MASTER
select SND_SOC_SSM2602_I2C if I2C
select SND_SOC_SSM4567 if I2C
select SND_SOC_STA32X if I2C
select SND_SOC_STA350 if I2C
select SND_SOC_STA529 if I2C
Expand Down Expand Up @@ -540,12 +541,20 @@ config SND_SOC_SSM2602
tristate

config SND_SOC_SSM2602_SPI
tristate "Analog Devices SSM2602 CODEC - SPI"
depends on SPI_MASTER
select SND_SOC_SSM2602
tristate
select REGMAP_SPI

config SND_SOC_SSM2602_I2C
tristate "Analog Devices SSM2602 CODEC - I2C"
depends on I2C
select SND_SOC_SSM2602
tristate
select REGMAP_I2C

config SND_SOC_SSM4567
tristate "Analog Devices ssm4567 amplifier driver support"
depends on I2C

config SND_SOC_STA32X
tristate
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ snd-soc-ssm2518-objs := ssm2518.o
snd-soc-ssm2602-objs := ssm2602.o
snd-soc-ssm2602-spi-objs := ssm2602-spi.o
snd-soc-ssm2602-i2c-objs := ssm2602-i2c.o
snd-soc-ssm4567-objs := ssm4567.o
snd-soc-sta32x-objs := sta32x.o
snd-soc-sta350-objs := sta350.o
snd-soc-sta529-objs := sta529.o
Expand Down Expand Up @@ -266,6 +267,7 @@ obj-$(CONFIG_SND_SOC_SSM2518) += snd-soc-ssm2518.o
obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o
obj-$(CONFIG_SND_SOC_SSM2602_SPI) += snd-soc-ssm2602-spi.o
obj-$(CONFIG_SND_SOC_SSM2602_I2C) += snd-soc-ssm2602-i2c.o
obj-$(CONFIG_SND_SOC_SSM4567) += snd-soc-ssm4567.o
obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o
obj-$(CONFIG_SND_SOC_STA350) += snd-soc-sta350.o
obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o
Expand Down
9 changes: 9 additions & 0 deletions sound/soc/codecs/ssm2602-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ static const struct i2c_device_id ssm2602_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id);

static const struct of_device_id ssm2602_of_match[] = {
{ .compatible = "adi,ssm2602", },
{ .compatible = "adi,ssm2603", },
{ .compatible = "adi,ssm2604", },
{ }
};
MODULE_DEVICE_TABLE(of, ssm2602_of_match);

static struct i2c_driver ssm2602_i2c_driver = {
.driver = {
.name = "ssm2602",
.owner = THIS_MODULE,
.of_match_table = ssm2602_of_match,
},
.probe = ssm2602_i2c_probe,
.remove = ssm2602_i2c_remove,
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/codecs/ssm2602-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ static int ssm2602_spi_remove(struct spi_device *spi)
return 0;
}

static const struct of_device_id ssm2602_of_match[] = {
{ .compatible = "adi,ssm2602", },
{ }
};
MODULE_DEVICE_TABLE(of, ssm2602_of_match);

static struct spi_driver ssm2602_spi_driver = {
.driver = {
.name = "ssm2602",
.owner = THIS_MODULE,
.of_match_table = ssm2602_of_match,
},
.probe = ssm2602_spi_probe,
.remove = ssm2602_spi_remove,
Expand Down
15 changes: 13 additions & 2 deletions sound/soc/codecs/ssm2602.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
};

static const unsigned int ssm2602_rates_11289600[] = {
8000, 44100, 88200,
8000, 11025, 22050, 44100, 88200,
};

static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = {
Expand Down Expand Up @@ -237,6 +237,16 @@ static const struct ssm2602_coeff ssm2602_coeff_table[] = {
{18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)},
{12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)},

/* 11.025k */
{11289600, 11025, SSM2602_COEFF_SRATE(0xc, 0x0, 0x0)},
{16934400, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x0)},
{12000000, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x1)},

/* 22.05k */
{11289600, 22050, SSM2602_COEFF_SRATE(0xd, 0x0, 0x0)},
{16934400, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x0)},
{12000000, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x1)},

/* 44.1k */
{11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)},
{16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)},
Expand Down Expand Up @@ -467,7 +477,8 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
return 0;
}

#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
SNDRV_PCM_RATE_96000)
Expand Down
Loading

0 comments on commit 248519c

Please sign in to comment.