Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/inte…
Browse files Browse the repository at this point in the history
…l', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next
  • Loading branch information
Mark Brown committed May 21, 2014
8 parents 3a6a489 + ee5e453 + 2fa190c + 0aa2a15 + a735d99 + c4839c8 + 780aaef + 7b4a469 commit 6630f30
Show file tree
Hide file tree
Showing 31 changed files with 745 additions and 431 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/mfd/mc13xxx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Optional properties:
- fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used

Sub-nodes:
- codec: Contain the Audio Codec node.
- adc-port: Contain PMIC SSI port number used for ADC.
- dac-port: Contain PMIC SSI port number used for DAC.
- leds : Contain the led nodes and initial register values in property
"led-control". Number of register depends of used IC, for MC13783 is 6,
for MC13892 is 4, for MC34708 is 1. See datasheet for bits definitions of
Expand Down
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/sound/max98095.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MAX98095 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "maxim,max98095".

- reg : The I2C address of the device.

Example:

max98095: codec@11 {
compatible = "maxim,max98095";
reg = <0x11>;
};
2 changes: 0 additions & 2 deletions arch/mips/include/asm/mach-jz4740/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ enum jz4740_dma_request_type {
JZ4740_DMA_TYPE_UART_RECEIVE = 21,
JZ4740_DMA_TYPE_SPI_TRANSMIT = 22,
JZ4740_DMA_TYPE_SPI_RECEIVE = 23,
JZ4740_DMA_TYPE_AIC_TRANSMIT = 24,
JZ4740_DMA_TYPE_AIC_RECEIVE = 25,
JZ4740_DMA_TYPE_MMC_TRANSMIT = 26,
JZ4740_DMA_TYPE_MMC_RECEIVE = 27,
JZ4740_DMA_TYPE_TCU = 28,
Expand Down
11 changes: 11 additions & 0 deletions arch/mips/jz4740/board-qi_lb60.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ static struct platform_device qi_lb60_audio_device = {
.id = -1,
};

static struct gpiod_lookup_table qi_lb60_audio_gpio_table = {
.dev_id = "qi-lb60-audio",
.table = {
GPIO_LOOKUP("Bank B", 29, "snd", 0),
GPIO_LOOKUP("Bank D", 4, "amp", 0),
{ },
},
};

static struct platform_device *jz_platform_devices[] __initdata = {
&jz4740_udc_device,
&jz4740_udc_xceiv_device,
Expand Down Expand Up @@ -461,6 +470,8 @@ static int __init qi_lb60_init_platform_devices(void)
jz4740_adc_device.dev.platform_data = &qi_lb60_battery_pdata;
jz4740_mmc_device.dev.platform_data = &qi_lb60_mmc_pdata;

gpiod_add_lookup_table(&qi_lb60_audio_gpio_table);

jz4740_serial_device_register();

spi_register_board_info(qi_lb60_spi_board_info,
Expand Down
10 changes: 7 additions & 3 deletions drivers/mfd/mc13xxx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,13 @@ int mc13xxx_common_init(struct device *dev)
if (mc13xxx->flags & MC13XXX_USE_ADC)
mc13xxx_add_subdevice(mc13xxx, "%s-adc");

if (mc13xxx->flags & MC13XXX_USE_CODEC)
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
pdata->codec, sizeof(*pdata->codec));
if (mc13xxx->flags & MC13XXX_USE_CODEC) {
if (pdata)
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec",
pdata->codec, sizeof(*pdata->codec));
else
mc13xxx_add_subdevice(mc13xxx, "%s-codec");
}

if (mc13xxx->flags & MC13XXX_USE_RTC)
mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
#include <linux/module.h>
#include <sound/soc.h>
#include <linux/of.h>
#include <linux/of_device.h>

#define DRV_NAME "hdmi-audio-codec"
Expand Down
47 changes: 35 additions & 12 deletions sound/soc/codecs/max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
Expand Down Expand Up @@ -1674,6 +1676,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
M98090_REG_CLOCK_RATIO_NI_LSB, 0x00);
snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE,
M98090_USE_M1_MASK, 0);
max98090->master = false;
break;
case SND_SOC_DAIFMT_CBM_CFM:
/* Set to master mode */
Expand All @@ -1690,6 +1693,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
regval |= M98090_MAS_MASK |
M98090_BSEL_32;
}
max98090->master = true;
break;
case SND_SOC_DAIFMT_CBS_CFM:
case SND_SOC_DAIFMT_CBM_CFS:
Expand Down Expand Up @@ -1793,13 +1797,6 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,

switch (level) {
case SND_SOC_BIAS_ON:
if (max98090->jack_state == M98090_JACK_STATE_HEADSET) {
/*
* Set to normal bias level.
*/
snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
}
break;

case SND_SOC_BIAS_PREPARE:
Expand Down Expand Up @@ -1873,7 +1870,8 @@ static int max98090_dai_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}

max98090_configure_bclk(codec);
if (max98090->master)
max98090_configure_bclk(codec);

cdata->rate = max98090->lrclk;

Expand Down Expand Up @@ -1952,8 +1950,6 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai,

max98090->sysclk = freq;

max98090_configure_bclk(codec);

return 0;
}

Expand Down Expand Up @@ -2225,6 +2221,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
/* Initialize private data */

max98090->sysclk = (unsigned)-1;
max98090->master = false;

cdata = &max98090->dai[0];
cdata->rate = (unsigned)-1;
Expand Down Expand Up @@ -2294,6 +2291,9 @@ static int max98090_probe(struct snd_soc_codec *codec)
snd_soc_write(codec, M98090_REG_BIAS_CONTROL,
M98090_VCM_MODE_MASK);

snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);

max98090_handle_pdata(codec);

max98090_add_widgets(codec);
Expand Down Expand Up @@ -2330,9 +2330,11 @@ static const struct regmap_config max98090_regmap = {
};

static int max98090_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
const struct i2c_device_id *i2c_id)
{
struct max98090_priv *max98090;
const struct acpi_device_id *acpi_id;
kernel_ulong_t driver_data = 0;
int ret;

pr_debug("max98090_i2c_probe\n");
Expand All @@ -2342,7 +2344,19 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
if (max98090 == NULL)
return -ENOMEM;

max98090->devtype = id->driver_data;
if (ACPI_HANDLE(&i2c->dev)) {
acpi_id = acpi_match_device(i2c->dev.driver->acpi_match_table,
&i2c->dev);
if (!acpi_id) {
dev_err(&i2c->dev, "No driver data\n");
return -EINVAL;
}
driver_data = acpi_id->driver_data;
} else if (i2c_id) {
driver_data = i2c_id->driver_data;
}

max98090->devtype = driver_data;
i2c_set_clientdata(i2c, max98090);
max98090->pdata = i2c->dev.platform_data;
max98090->irq = i2c->irq;
Expand Down Expand Up @@ -2433,12 +2447,21 @@ static const struct of_device_id max98090_of_match[] = {
};
MODULE_DEVICE_TABLE(of, max98090_of_match);

#ifdef CONFIG_ACPI
static struct acpi_device_id max98090_acpi_match[] = {
{ "193C9890", MAX98090 },
{ }
};
MODULE_DEVICE_TABLE(acpi, max98090_acpi_match);
#endif

static struct i2c_driver max98090_i2c_driver = {
.driver = {
.name = "max98090",
.owner = THIS_MODULE,
.pm = &max98090_pm,
.of_match_table = of_match_ptr(max98090_of_match),
.acpi_match_table = ACPI_PTR(max98090_acpi_match),
},
.probe = max98090_i2c_probe,
.remove = max98090_i2c_remove,
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/max98090.h
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,7 @@ struct max98090_priv {
unsigned int pa2en;
unsigned int extmic_mux;
unsigned int sidetone;
bool master;
};

int max98090_mic_detect(struct snd_soc_codec *codec,
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/codecs/max98095.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,10 +2399,17 @@ static const struct i2c_device_id max98095_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98095_i2c_id);

static const struct of_device_id max98095_of_match[] = {
{ .compatible = "maxim,max98095", },
{ }
};
MODULE_DEVICE_TABLE(of, max98095_of_match);

static struct i2c_driver max98095_i2c_driver = {
.driver = {
.name = "max98095",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(max98095_of_match),
},
.probe = max98095_i2c_probe,
.remove = max98095_i2c_remove,
Expand Down
14 changes: 13 additions & 1 deletion sound/soc/codecs/mc13783.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
#include <linux/module.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/mfd/mc13xxx.h>
#include <linux/slab.h>
#include <sound/core.h>
Expand Down Expand Up @@ -748,6 +749,7 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
{
struct mc13783_priv *priv;
struct mc13xxx_codec_platform_data *pdata = pdev->dev.platform_data;
struct device_node *np;
int ret;

priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
Expand All @@ -758,7 +760,17 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
priv->adc_ssi_port = pdata->adc_ssi_port;
priv->dac_ssi_port = pdata->dac_ssi_port;
} else {
return -ENOSYS;
np = of_get_child_by_name(pdev->dev.parent->of_node, "codec");
if (!np)
return -ENOSYS;

ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port);
if (ret)
return ret;

ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port);
if (ret)
return ret;
}

dev_set_drvdata(&pdev->dev, priv);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/tlv320aic23-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <sound/soc.h>

Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/tlv320aic31xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/slab.h>
#include <sound/core.h>
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/tpa6130a2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <sound/tpa6130a2-plat.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <linux/of.h>
#include <linux/of_gpio.h>

#include "tpa6130a2.h"
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o
snd-soc-sst-acpi-objs := sst-acpi.o

snd-soc-sst-mfld-platform-objs := sst-mfld-platform.o
snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o sst-mfld-platform-compress.o
snd-soc-mfld-machine-objs := mfld_machine.o

obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += snd-soc-sst-mfld-platform.o
Expand Down
28 changes: 13 additions & 15 deletions sound/soc/intel/byt-rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,13 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
{
.name = "Baytrail Audio",
.stream_name = "Audio",
.cpu_dai_name = "Front-cpu-dai",
.cpu_dai_name = "baytrail-pcm-audio",
.codec_dai_name = "rt5640-aif1",
.codec_name = "i2c-10EC5640:00",
.platform_name = "baytrail-pcm-audio",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
.init = byt_rt5640_init,
.ignore_suspend = 1,
.ops = &byt_rt5640_ops,
},
{
.name = "Baytrail Voice",
.stream_name = "Voice",
.cpu_dai_name = "Mic1-cpu-dai",
.codec_dai_name = "rt5640-aif1",
.codec_name = "i2c-10EC5640:00",
.platform_name = "baytrail-pcm-audio",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
.init = NULL,
.ignore_suspend = 1,
.ops = &byt_rt5640_ops,
},
};
Expand All @@ -146,6 +132,17 @@ static struct snd_soc_card byt_rt5640_card = {
.num_dapm_routes = ARRAY_SIZE(byt_rt5640_audio_map),
};

#ifdef CONFIG_PM_SLEEP
static const struct dev_pm_ops byt_rt5640_pm_ops = {
.suspend = snd_soc_suspend,
.resume = snd_soc_resume,
};

#define BYT_RT5640_PM_OPS (&byt_rt5640_pm_ops)
#else
#define BYT_RT5640_PM_OPS NULL
#endif

static int byt_rt5640_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &byt_rt5640_card;
Expand All @@ -171,6 +168,7 @@ static struct platform_driver byt_rt5640_audio = {
.driver = {
.name = "byt-rt5640",
.owner = THIS_MODULE,
.pm = BYT_RT5640_PM_OPS,
},
};
module_platform_driver(byt_rt5640_audio)
Expand Down
Loading

0 comments on commit 6630f30

Please sign in to comment.