Skip to content

Commit

Permalink
Merge tag 'asoc-v4.3-rc2' into asoc-next
Browse files Browse the repository at this point in the history
ASoC: Updates for v4.4

A first batch of updates targetted at v4.4.  There are no substantial
core fixes here, the biggest block of changes is updates to the rcar
drivers and the addition of a CODEC driver for the AK4613.

# gpg: Signature made Fri 25 Sep 2015 05:37:06 KST using RSA key ID 5D5487D0
# gpg: key CD7BEEBC: no public key for trusted key - skipped
# gpg: key CD7BEEBC marked as ultimately trusted
# gpg: key AF88CD16: no public key for trusted key - skipped
# gpg: key AF88CD16 marked as ultimately trusted
# gpg: key 16005C11: no public key for trusted key - skipped
# gpg: key 16005C11 marked as ultimately trusted
# gpg: key 5621E907: no public key for trusted key - skipped
# gpg: key 5621E907 marked as ultimately trusted
# gpg: key 5C6153AD: no public key for trusted key - skipped
# gpg: key 5C6153AD marked as ultimately trusted
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
  • Loading branch information
Mark Brown committed Oct 26, 2015
2 parents 32b8819 + 4922e7a commit 7c9c29e
Show file tree
Hide file tree
Showing 76 changed files with 2,362 additions and 759 deletions.
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/sound/ak4613.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AK4613 I2C transmitter

This device supports I2C mode only.

Required properties:

- compatible : "asahi-kasei,ak4613"
- reg : The chip select number on the I2C bus

Example:

&i2c {
ak4613: ak4613@0x10 {
compatible = "asahi-kasei,ak4613";
reg = <0x10>;
};
};
22 changes: 21 additions & 1 deletion Documentation/devicetree/bindings/sound/ak4642.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,31 @@ Required properties:
- compatible : "asahi-kasei,ak4642" or "asahi-kasei,ak4643" or "asahi-kasei,ak4648"
- reg : The chip select number on the I2C bus

Example:
Optional properties:

- #clock-cells : common clock binding; shall be set to 0
- clocks : common clock binding; MCKI clock
- clock-frequency : common clock binding; frequency of MCKO
- clock-output-names : common clock binding; MCKO clock name

Example 1:

&i2c {
ak4648: ak4648@0x12 {
compatible = "asahi-kasei,ak4642";
reg = <0x12>;
};
};

Example 2:

&i2c {
ak4643: codec@12 {
compatible = "asahi-kasei,ak4643";
reg = <0x12>;
#clock-cells = <0>;
clocks = <&audio_clock>;
clock-frequency = <12288000>;
clock-output-names = "ak4643_mcko";
};
};
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/sound/renesas,rsnd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Required properties:
- compatible : "renesas,rcar_sound-<soctype>", fallbacks
"renesas,rcar_sound-gen1" if generation1, and
"renesas,rcar_sound-gen2" if generation2
"renesas,rcar_sound-gen3" if generation3
Examples with soctypes are:
- "renesas,rcar_sound-r8a7778" (R-Car M1A)
- "renesas,rcar_sound-r8a7790" (R-Car H2)
- "renesas,rcar_sound-r8a7791" (R-Car M2-W)
- "renesas,rcar_sound-r8a7795" (R-Car H3)
- reg : Should contain the register physical address.
required register is
SRU/ADG/SSI if generation1
Expand All @@ -30,6 +32,11 @@ Required properties:
- rcar_sound,dai : DAI contents.
The number of DAI subnode should be same as HW.
see below for detail.
- #sound-dai-cells : it must be 0 if your system is using single DAI
it must be 1 if your system is using multi DAI
- #clock-cells : it must be 0 if your system has audio_clkout
it must be 1 if your system has audio_clkout0/1/2/3
- clock-frequency : for all audio_clkout0/1/2/3

SSI subnode properties:
- interrupts : Should contain SSI interrupt for PIO transfer
Expand Down
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/sound/sun4i-codec.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
* Allwinner A10 Codec

Required properties:
- compatible: must be either "allwinner,sun4i-a10-codec" or
"allwinner,sun7i-a20-codec"
- reg: must contain the registers location and length
- interrupts: must contain the codec interrupt
- dmas: DMA channels for tx and rx dma. See the DMA client binding,
Documentation/devicetree/bindings/dma/dma.txt
- dma-names: should include "tx" and "rx".
- clocks: a list of phandle + clock-specifer pairs, one for each entry
in clock-names.
- clock-names: should contain followings:
- "apb": the parent APB clock for this controller
- "codec": the parent module clock
- routing : A list of the connections between audio components. Each
entry is a pair of strings, the first being the connection's sink,
the second being the connection's source.


Example:
codec: codec@01c22c00 {
#sound-dai-cells = <0>;
compatible = "allwinner,sun7i-a20-codec";
reg = <0x01c22c00 0x40>;
interrupts = <0 30 4>;
clocks = <&apb0_gates 0>, <&codec_clk>;
clock-names = "apb", "codec";
dmas = <&dma 0 19>, <&dma 0 19>;
dma-names = "rx", "tx";
routing = "Headphone Jack", "HP Right",
"Headphone Jack", "HP Left";
};
11 changes: 10 additions & 1 deletion Documentation/devicetree/bindings/sound/tdm-slot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ This specifies audio DAI's TDM slot.

TDM slot properties:
dai-tdm-slot-num : Number of slots in use.
dai-tdm-slot-width : Width in bits for each slot.
dai-tdm-slot-width : Width in bits for each slot.
dai-tdm-slot-tx-mask : Transmit direction slot mask, optional
dai-tdm-slot-rx-mask : Receive direction slot mask, optional

For instance:
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <8>;
dai-tdm-slot-tx-mask = <0 1>;
dai-tdm-slot-rx-mask = <1 0>;

And for each spcified driver, there could be one .of_xlate_tdm_slot_mask()
to specify a explicit mapping of the channels and the slots. If it's absent
Expand All @@ -18,3 +22,8 @@ tx and rx masks.
For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit
for an active slot as default, and the default active bits are at the LSB of
the masks.

The explicit masks are given as array of integers, where the first
number presents bit-0 (LSB), second presents bit-1, etc. Any non zero
number is considered 1 and 0 is 0. snd_soc_of_xlate_tdm_slot_mask()
does not do anything, if either mask is set non zero value.
21 changes: 6 additions & 15 deletions drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,14 +871,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,
* Calculate the lowest divider that satisfies the
* constraint, assuming div32/fdiv/mbz == 0.
*/
if (xfer->speed_hz)
scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz);
else
/*
* This can happend if max_speed is null.
* In this case, we set the lowest possible speed
*/
scbr = 0xff;
scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz);

/*
* If the resulting divider doesn't fit into the
Expand Down Expand Up @@ -1300,14 +1293,12 @@ static int atmel_spi_one_transfer(struct spi_master *master,
return -EINVAL;
}

if (xfer->bits_per_word) {
asd = spi->controller_state;
bits = (asd->csr >> 4) & 0xf;
if (bits != xfer->bits_per_word - 8) {
dev_dbg(&spi->dev,
asd = spi->controller_state;
bits = (asd->csr >> 4) & 0xf;
if (bits != xfer->bits_per_word - 8) {
dev_dbg(&spi->dev,
"you can't yet change bits_per_word in transfers\n");
return -ENOPROTOOPT;
}
return -ENOPROTOOPT;
}

/*
Expand Down
1 change: 0 additions & 1 deletion include/sound/rcar_snd.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#ifndef RCAR_SND_H
#define RCAR_SND_H

#include <linux/sh_clk.h>

#define RSND_GEN1_SRU 0
#define RSND_GEN1_ADG 1
Expand Down
2 changes: 2 additions & 0 deletions include/sound/rt5645.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ struct rt5645_platform_data {
/* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */

unsigned int jd_mode;
/* Invert JD when jack insert */
bool jd_invert;
};

#endif
2 changes: 2 additions & 0 deletions include/sound/simple_card.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ struct asoc_simple_dai {
unsigned int sysclk;
int slots;
int slot_width;
unsigned int tx_slot_mask;
unsigned int rx_slot_mask;
struct clk *clk;
};

Expand Down
14 changes: 14 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,18 @@
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
#define SOC_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \
xhandler_get, xhandler_put, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
SNDRV_CTL_ELEM_ACCESS_READWRITE,\
.tlv.p = (tlv_array), \
.info = snd_soc_info_volsw_range, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = (unsigned long)&(struct soc_mixer_control) \
{.reg = xreg, .rreg = xreg, .shift = xshift, \
.rshift = xshift, .min = xmin, .max = xmax, \
.platform_max = xmax, .invert = xinvert} }
#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
xhandler_get, xhandler_put, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
Expand Down Expand Up @@ -1603,6 +1615,8 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
const char *propname);
int snd_soc_of_parse_tdm_slot(struct device_node *np,
unsigned int *tx_mask,
unsigned int *rx_mask,
unsigned int *slots,
unsigned int *slot_width);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
Expand Down
1 change: 1 addition & 0 deletions sound/soc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ source "sound/soc/sh/Kconfig"
source "sound/soc/sirf/Kconfig"
source "sound/soc/spear/Kconfig"
source "sound/soc/sti/Kconfig"
source "sound/soc/sunxi/Kconfig"
source "sound/soc/tegra/Kconfig"
source "sound/soc/txx9/Kconfig"
source "sound/soc/ux500/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions sound/soc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ obj-$(CONFIG_SND_SOC) += sh/
obj-$(CONFIG_SND_SOC) += sirf/
obj-$(CONFIG_SND_SOC) += spear/
obj-$(CONFIG_SND_SOC) += sti/
obj-$(CONFIG_SND_SOC) += sunxi/
obj-$(CONFIG_SND_SOC) += tegra/
obj-$(CONFIG_SND_SOC) += txx9/
obj-$(CONFIG_SND_SOC) += ux500/
Expand Down
1 change: 1 addition & 0 deletions sound/soc/atmel/atmel_wm8904.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ static const struct of_device_id atmel_asoc_wm8904_dt_ids[] = {
{ .compatible = "atmel,asoc-wm8904", },
{ }
};
MODULE_DEVICE_TABLE(of, atmel_asoc_wm8904_dt_ids);
#endif

static struct platform_driver atmel_asoc_wm8904_driver = {
Expand Down
10 changes: 1 addition & 9 deletions sound/soc/au1x/db1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ static int db1000_audio_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &db1000_ac97;
card->dev = &pdev->dev;
return snd_soc_register_card(card);
}

static int db1000_audio_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
snd_soc_unregister_card(card);
return 0;
return devm_snd_soc_register_card(&pdev->dev, card);
}

static struct platform_driver db1000_audio_driver = {
Expand All @@ -54,7 +47,6 @@ static struct platform_driver db1000_audio_driver = {
.pm = &snd_soc_pm_ops,
},
.probe = db1000_audio_probe,
.remove = db1000_audio_remove,
};

module_platform_driver(db1000_audio_driver);
Expand Down
10 changes: 1 addition & 9 deletions sound/soc/au1x/db1200.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,7 @@ static int db1200_audio_probe(struct platform_device *pdev)

card = db1200_cards[pid->driver_data];
card->dev = &pdev->dev;
return snd_soc_register_card(card);
}

static int db1200_audio_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
snd_soc_unregister_card(card);
return 0;
return devm_snd_soc_register_card(&pdev->dev, card);
}

static struct platform_driver db1200_audio_driver = {
Expand All @@ -195,7 +188,6 @@ static struct platform_driver db1200_audio_driver = {
},
.id_table = db1200_pids,
.probe = db1200_audio_probe,
.remove = db1200_audio_remove,
};

module_platform_driver(db1200_audio_driver);
Expand Down
11 changes: 1 addition & 10 deletions sound/soc/blackfin/bf5xx-ad1836.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,18 @@ static int bf5xx_ad1836_driver_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);

ret = snd_soc_register_card(card);
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret)
dev_err(&pdev->dev, "Failed to register card\n");
return ret;
}

static int bf5xx_ad1836_driver_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);
return 0;
}

static struct platform_driver bf5xx_ad1836_driver = {
.driver = {
.name = "bfin-snd-ad1836",
.pm = &snd_soc_pm_ops,
},
.probe = bf5xx_ad1836_driver_probe,
.remove = bf5xx_ad1836_driver_remove,
};
module_platform_driver(bf5xx_ad1836_driver);

Expand Down
12 changes: 1 addition & 11 deletions sound/soc/blackfin/bfin-eval-adau1373.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,7 @@ static int bfin_eval_adau1373_probe(struct platform_device *pdev)

card->dev = &pdev->dev;

return snd_soc_register_card(&bfin_eval_adau1373);
}

static int bfin_eval_adau1373_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);

return 0;
return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adau1373);
}

static struct platform_driver bfin_eval_adau1373_driver = {
Expand All @@ -172,7 +163,6 @@ static struct platform_driver bfin_eval_adau1373_driver = {
.pm = &snd_soc_pm_ops,
},
.probe = bfin_eval_adau1373_probe,
.remove = bfin_eval_adau1373_remove,
};

module_platform_driver(bfin_eval_adau1373_driver);
Expand Down
12 changes: 1 addition & 11 deletions sound/soc/blackfin/bfin-eval-adau1701.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,7 @@ static int bfin_eval_adau1701_probe(struct platform_device *pdev)

card->dev = &pdev->dev;

return snd_soc_register_card(&bfin_eval_adau1701);
}

static int bfin_eval_adau1701_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);

return 0;
return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adau1701);
}

static struct platform_driver bfin_eval_adau1701_driver = {
Expand All @@ -112,7 +103,6 @@ static struct platform_driver bfin_eval_adau1701_driver = {
.pm = &snd_soc_pm_ops,
},
.probe = bfin_eval_adau1701_probe,
.remove = bfin_eval_adau1701_remove,
};

module_platform_driver(bfin_eval_adau1701_driver);
Expand Down
Loading

0 comments on commit 7c9c29e

Please sign in to comment.