Add ES8328 audio codec
Subsystems (5)
v3 cover Add ES8328 audio codec
This patchset adds support for the Everest Semi ES8328 audio codec. It also adds support for using the es8328 on IMX boards.
We write a machine driver rather than using simple-card because the machine driver needs to support regulators for the codec itself and speaker amps, have headphone support, and must supply an unusual frequency to the codec chip.
Changes since v2:
- Change deemph to a bool, and update based on sample rate
- Replace value enums with regular enums
- Break SPI and I2C drivers into their own modules
- Rename everest,es8328 to es8328 as the module wasn't getting detected. Because of this, the patch to vendor-prefixes.txt has been dropped.
Changes since v1:
- Rename HP/Speaker to OUT1/OUT2
- Use DAPM widgets for startup/shutdown
- Add regulator support to machine driver
*** BLURB HERE ***
Sean Cross (2):
ASoC: add es8328 codec driver
ASoC: fsl: add imx-es8328 machine driver
Documentation/devicetree/bindings/sound/es8328.txt | 18 + .../devicetree/bindings/sound/imx-audio-es8328.txt | 60 ++ sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ sound/soc/fsl/Kconfig | 14 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/imx-es8328.c | 359 ++++++++++++ 11 files changed, 1509 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/es8328.txt create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-es8328.txt create mode 100644 sound/soc/codecs/es8328-i2c.c create mode 100644 sound/soc/codecs/es8328-spi.c create mode 100644 sound/soc/codecs/es8328.c create mode 100644 sound/soc/codecs/es8328.h create mode 100644 sound/soc/fsl/imx-es8328.c
Signature · 6 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1402997571-1255-1-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org
PATCH v3 1/2 ASoC: add es8328 codec driver
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/es8328.txt create mode 100644 sound/soc/codecs/es8328-i2c.c create mode 100644 sound/soc/codecs/es8328-spi.c create mode 100644 sound/soc/codecs/es8328.c create mode 100644 sound/soc/codecs/es8328.h
Documentation/devicetree/bindings/sound/es8328.txt new file +18 -0
@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328" + + - reg : the I2C address of the device for I2C, the chip select + number for SPI. + +Example: + +codec: es8328@11 { + compatible = "es8328"; + reg = <0x11>; +};
sound/soc/codecs/Kconfig +13 -0
@@ -56,6 +56,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_DA732X if I2C select SND_SOC_DA9055 if I2C select SND_SOC_BT_SCO + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C select SND_SOC_ISABELLE if I2C select SND_SOC_JZ4740_CODEC select SND_SOC_LM4857 if I2C
@@ -396,6 +398,17 @@ config SND_SOC_DMIC config SND_SOC_HDMI_CODEC tristate "HDMI stub CODEC" +config SND_SOC_ES8328 + tristate "Everest Semi ES8328 CODEC" + +config SND_SOC_ES8328_I2C + tristate + select SND_SOC_ES8328 + +config SND_SOC_ES8328_SPI + tristate + select SND_SOC_ES8328 + config SND_SOC_ISABELLE tristate
sound/soc/codecs/Makefile +6 -0
@@ -48,6 +48,9 @@ snd-soc-da732x-objs := da732x.o snd-soc-da9055-objs := da9055.o snd-soc-bt-sco-objs := bt-sco.o snd-soc-dmic-objs := dmic.o +snd-soc-es8328-objs := es8328.o +snd-soc-es8328-i2c-objs := es8328-i2c.o +snd-soc-es8328-spi-objs := es8328-spi.o snd-soc-isabelle-objs := isabelle.o snd-soc-jz4740-codec-objs := jz4740.o snd-soc-l3-objs := l3.o
@@ -213,6 +216,9 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o +obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o +obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o +obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
sound/soc/codecs/es8328-i2c.c new file +55 -0
55 lines not on this page · raw message
sound/soc/codecs/es8328-spi.c new file +44 -0
44 lines not on this page · raw message
sound/soc/codecs/es8328.c new file +625 -0
625 lines not on this page · raw message
sound/soc/codecs/es8328.h new file +313 -0
313 lines not on this page · raw message
Signature · 6 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1402997571-1255-2-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org
Re: [alsa-devel] [PATCH v3 1/2] ASoC: add es8328 codec driver
Quoted 25 lines · Sean Cross
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
Signed-off-by Sean Cross <[email protected]>--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/es8328.txt create mode 100644 sound/soc/codecs/es8328-i2c.c create mode 100644 sound/soc/codecs/es8328-spi.c create mode 100644 sound/soc/codecs/es8328.c create mode 100644 sound/soc/codecs/es8328.hDocumentation/devicetree/bindings/sound/es8328.txt new file +0
-0
Documentation/devicetree/bindings/sound/es8328.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +8
-0@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328"
I suspect the vendor prefix will be mandatory.
Quoted 161 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +10
-0+ + - reg : the I2C address of the device for I2C, the chip select + number for SPI. + +Example: + +codec: es8328@11 { + compatible = "es8328"; + reg = <0x11>; +};sound/soc/codecs/Kconfig +13
-0@@ -56,6 +56,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_DA732X if I2C select SND_SOC_DA9055 if I2C select SND_SOC_BT_SCO + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C select SND_SOC_ISABELLE if I2C select SND_SOC_JZ4740_CODEC select SND_SOC_LM4857 if I2C@@ -396,6 +398,17 @@ config SND_SOC_DMIC config SND_SOC_HDMI_CODEC tristate "HDMI stub CODEC" +config SND_SOC_ES8328 + tristate "Everest Semi ES8328 CODEC" + +config SND_SOC_ES8328_I2C + tristate + select SND_SOC_ES8328 + +config SND_SOC_ES8328_SPI + tristate + select SND_SOC_ES8328 + config SND_SOC_ISABELLE tristatesound/soc/codecs/Makefile +6
-0@@ -48,6 +48,9 @@ snd-soc-da732x-objs := da732x.o snd-soc-da9055-objs := da9055.o snd-soc-bt-sco-objs := bt-sco.o snd-soc-dmic-objs := dmic.o +snd-soc-es8328-objs := es8328.o +snd-soc-es8328-i2c-objs := es8328-i2c.o +snd-soc-es8328-spi-objs := es8328-spi.o snd-soc-isabelle-objs := isabelle.o snd-soc-jz4740-codec-objs := jz4740.o snd-soc-l3-objs := l3.o@@ -213,6 +216,9 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o +obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o +obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o +obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.osound/soc/codecs/es8328-i2c.c new file +55
-0@@ -0,0 +1,55 @@ +/* +* es8328-i2c.c -- ES8328 ALSA SoC I2C Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/i2c.h> +#include <linux/regmap.h> + +#include <sound/soc.h> + +#include "es8328.h" + +static const struct i2c_device_id es8328_id[] = { + {"es8328" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, es8328_id); + +static int es8328_i2c_probe (struct i2c_client *i2c, +const struct i2c_device_id *id) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&i2c->dev,devm_regmap_init_i2c (i2c, &config)); +} + +static int es8328_i2c_remove (struct i2c_client *i2c) +{ +snd_soc_unregister_codec (&i2c->dev); +return 0 ; +} + +static struct i2c_driver es8328_i2c_driver = { + .driver = { + .name ="es8328" , + }, + .probe = es8328_i2c_probe, + .remove = es8328_i2c_remove, + .id_table = es8328_id, +}; + +module_i2c_driver (es8328_i2c_driver); + +MODULE_DESCRIPTION ("ASoC ES8328 audio CODEC I2C driver" ); +MODULE_AUTHOR ("Sean Cross <[email protected]>" ); +MODULE_LICENSE ("GPL" );sound/soc/codecs/es8328-spi.c new file +29
-0@@ -0,0 +1,44 @@ +/* +* es8328.c -- ES8328 ALSA SoC SPI Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/spi/spi.h> +#include <sound/soc.h> +#include "es8328.h" + +static int es8328_spi_probe (struct spi_device *spi) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&spi->dev,devm_regmap_init_spi (spi, &config)); +} + +static int es8328_spi_remove (struct spi_device *spi) +{ +snd_soc_unregister_codec (&spi->dev);
sound/soc/codecs/es8328-spi.c line 39
Quoted 10 lines
sound/soc/codecs/es8328-spi.c new file +10
-0+return 0 ; +} + +static struct spi_driver es8328_spi_driver = { + .driver = { + .name ="es8328" , + }, + .probe = es8328_spi_probe, + .remove = es8328_spi_remove, +};
Your of_match_table seems to have gone missing since the last version I suspect that is why you had trouble with the vendor prefix. Ditto for the I2C as well.
Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20140617104639.GD26741-yzvPICuk2AATkU/[email protected]
Re: [alsa-devel] [PATCH v3 1/2] ASoC: add es8328 codec driver
Quoted 202 lines · Charles Keepax
Quoted 25 lines · Sean Cross
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
Signed-off-by Sean Cross <[email protected]>--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/es8328.txt create mode 100644 sound/soc/codecs/es8328-i2c.c create mode 100644 sound/soc/codecs/es8328-spi.c create mode 100644 sound/soc/codecs/es8328.c create mode 100644 sound/soc/codecs/es8328.hDocumentation/devicetree/bindings/sound/es8328.txt new file +0
-0Documentation/devicetree/bindings/sound/es8328.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +8
-0@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328"I suspect the vendor prefix will be mandatory.
Quoted 166 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +10
-0+ + - reg : the I2C address of the device for I2C, the chip select + number for SPI. + +Example: + +codec: es8328@11 { + compatible = "es8328"; + reg = <0x11>; +};sound/soc/codecs/Kconfig +13
-0@@ -56,6 +56,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_DA732X if I2C select SND_SOC_DA9055 if I2C select SND_SOC_BT_SCO + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C select SND_SOC_ISABELLE if I2C select SND_SOC_JZ4740_CODEC select SND_SOC_LM4857 if I2C@@ -396,6 +398,17 @@ config SND_SOC_DMIC config SND_SOC_HDMI_CODEC tristate "HDMI stub CODEC" +config SND_SOC_ES8328 + tristate "Everest Semi ES8328 CODEC" + +config SND_SOC_ES8328_I2C + tristate + select SND_SOC_ES8328 + +config SND_SOC_ES8328_SPI + tristate + select SND_SOC_ES8328 + config SND_SOC_ISABELLE tristatesound/soc/codecs/Makefile +6
-0@@ -48,6 +48,9 @@ snd-soc-da732x-objs := da732x.o snd-soc-da9055-objs := da9055.o snd-soc-bt-sco-objs := bt-sco.o snd-soc-dmic-objs := dmic.o +snd-soc-es8328-objs := es8328.o +snd-soc-es8328-i2c-objs := es8328-i2c.o +snd-soc-es8328-spi-objs := es8328-spi.o snd-soc-isabelle-objs := isabelle.o snd-soc-jz4740-codec-objs := jz4740.o snd-soc-l3-objs := l3.o@@ -213,6 +216,9 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o +obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o +obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o +obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.osound/soc/codecs/es8328-i2c.c new file +55
-0@@ -0,0 +1,55 @@ +/* +* es8328-i2c.c -- ES8328 ALSA SoC I2C Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/i2c.h> +#include <linux/regmap.h> + +#include <sound/soc.h> + +#include "es8328.h" + +static const struct i2c_device_id es8328_id[] = { + {"es8328" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, es8328_id); + +static int es8328_i2c_probe (struct i2c_client *i2c, +const struct i2c_device_id *id) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&i2c->dev,devm_regmap_init_i2c (i2c, &config)); +} + +static int es8328_i2c_remove (struct i2c_client *i2c) +{ +snd_soc_unregister_codec (&i2c->dev); +return 0 ; +} + +static struct i2c_driver es8328_i2c_driver = { + .driver = { + .name ="es8328" , + }, + .probe = es8328_i2c_probe, + .remove = es8328_i2c_remove, + .id_table = es8328_id, +}; + +module_i2c_driver (es8328_i2c_driver); + +MODULE_DESCRIPTION ("ASoC ES8328 audio CODEC I2C driver" ); +MODULE_AUTHOR ("Sean Cross <[email protected]>" ); +MODULE_LICENSE ("GPL" );sound/soc/codecs/es8328-spi.c new file +34
-0@@ -0,0 +1,44 @@ +/* +* es8328.c -- ES8328 ALSA SoC SPI Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/spi/spi.h> +#include <sound/soc.h> +#include "es8328.h" + +static int es8328_spi_probe (struct spi_device *spi) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&spi->dev,devm_regmap_init_spi (spi, &config)); +} + +static int es8328_spi_remove (struct spi_device *spi) +{ +snd_soc_unregister_codec (&spi->dev); +return 0 ; +} + +static struct spi_driver es8328_spi_driver = { + .driver = {
Quoted 8 lines
sound/soc/codecs/es8328-spi.c line 39
Quoted 5 lines
sound/soc/codecs/es8328-spi.c new file +5
-0+ .name = "es8328", + }, + .probe = es8328_spi_probe, + .remove = es8328_spi_remove, +};Your
of_match_tableseems to have gone missing since the last version I suspect that is why you had trouble with the vendor prefix. Ditto for the I2C as well.
I was basing the driver off the 6c3d713e6d32706999689e379a9098afb4cd8a2c commit mentioned in the previous comment. In that commit, there is an id_table in ad193x-i2c.c. ad193x.c doesn't have an of_match_table, which makes sense because I'm trying to load the I2C device.
I see now that of_match_table is distinct from the id_table. I assumed the I2C bus would walk the i2c_driver's id_table and load it that way.
How should this work, then? Should I specify the same "everest,es8328" compatible array to both the I2C and the SPI driver, and let the different buses sort it out? Or should I rename one to, say, "everest,es8328-i2c" and the other to "everest,es8328-spi"?
Also, for my own curiosity, what is the difference between the I2C id_table and the generic driver of_match_table?
Sean
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [alsa-devel] [PATCH v3 1/2] ASoC: add es8328 codec driver
Quoted 211 lines · Sean Cross
Quoted 202 lines · Charles Keepax
Quoted 25 lines · Sean Cross
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
Signed-off-by Sean Cross <[email protected]>--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/es8328.txtcreate mode 100644sound/soc/codecs/es8328-i2c.c
create mode 100644sound/soc/codecs/es8328-spi.c
create mode 100644sound/soc/codecs/es8328.c
create mode 100644sound/soc/codecs/es8328.hDocumentation/devicetree/bindings/sound/es8328.txt new file +0
-0Documentation/devicetree/bindings/sound/es8328.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +8
-0@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328"I suspect the vendor prefix will be mandatory.
Quoted 166 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +10
-0+ + - reg : the I2C address of the device for I2C, the chip select + number for SPI. + +Example: + +codec: es8328@11 { + compatible = "es8328"; + reg = <0x11>; +};sound/soc/codecs/Kconfig +13
-0@@ -56,6 +56,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_DA732X if I2C select SND_SOC_DA9055 if I2C select SND_SOC_BT_SCO + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C select SND_SOC_ISABELLE if I2C select SND_SOC_JZ4740_CODEC select SND_SOC_LM4857 if I2C@@ -396,6 +398,17 @@ config SND_SOC_DMIC config SND_SOC_HDMI_CODEC tristate "HDMI stub CODEC" +config SND_SOC_ES8328 + tristate "Everest Semi ES8328 CODEC" + +config SND_SOC_ES8328_I2C + tristate + select SND_SOC_ES8328 + +config SND_SOC_ES8328_SPI + tristate + select SND_SOC_ES8328 + config SND_SOC_ISABELLE tristatesound/soc/codecs/Makefile +6
-0@@ -48,6 +48,9 @@ snd-soc-da732x-objs := da732x.o snd-soc-da9055-objs := da9055.o snd-soc-bt-sco-objs := bt-sco.o snd-soc-dmic-objs := dmic.o +snd-soc-es8328-objs := es8328.o +snd-soc-es8328-i2c-objs := es8328-i2c.o +snd-soc-es8328-spi-objs := es8328-spi.o snd-soc-isabelle-objs := isabelle.o snd-soc-jz4740-codec-objs := jz4740.o snd-soc-l3-objs := l3.o@@ -213,6 +216,9 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o +obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o +obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o +obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.osound/soc/codecs/es8328-i2c.c new file +55
-0@@ -0,0 +1,55 @@ +/* +* es8328-i2c.c -- ES8328 ALSA SoC I2C Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/i2c.h> +#include <linux/regmap.h> + +#include <sound/soc.h> + +#include "es8328.h" + +static const struct i2c_device_id es8328_id[] = { + {"es8328" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, es8328_id); + +static int es8328_i2c_probe (struct i2c_client *i2c, +const struct i2c_device_id *id) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&i2c->dev,devm_regmap_init_i2c (i2c, &config)); +} + +static int es8328_i2c_remove (struct i2c_client *i2c) +{ +snd_soc_unregister_codec (&i2c->dev); +return 0 ; +} + +static struct i2c_driver es8328_i2c_driver = { + .driver = { + .name ="es8328" , + }, + .probe = es8328_i2c_probe, + .remove = es8328_i2c_remove, + .id_table = es8328_id, +}; + +module_i2c_driver (es8328_i2c_driver); + +MODULE_DESCRIPTION ("ASoC ES8328 audio CODEC I2C driver" ); +MODULE_AUTHOR ("Sean Cross <[email protected]>" ); +MODULE_LICENSE ("GPL" );sound/soc/codecs/es8328-spi.c new file +34
-0@@ -0,0 +1,44 @@ +/* +* es8328.c -- ES8328 ALSA SoC SPI Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/spi/spi.h> +#include <sound/soc.h> +#include "es8328.h" + +static int es8328_spi_probe (struct spi_device *spi) +{ +struct regmap_config config; + + config = es8328_regmap_config; +return es8328_probe (&spi->dev,devm_regmap_init_spi (spi, &config)); +} + +static int es8328_spi_remove (struct spi_device *spi) +{ +snd_soc_unregister_codec (&spi->dev); +return 0 ; +} + +static struct spi_driver es8328_spi_driver = { + .driver = {Quoted 8 lines
sound/soc/codecs/es8328-spi.c line 39
Quoted 5 lines
sound/soc/codecs/es8328-spi.c new file +5
-0+ .name = "es8328", + }, + .probe = es8328_spi_probe, + .remove = es8328_spi_remove, +};Your
of_match_tableseems to have gone missing since the last version I suspect that is why you had trouble with the vendor prefix. Ditto for the I2C as well.
Quoted 4 lines
I was basing the driver off the
6c3d713e6d32706999689e379a9098afb4cd8a2ccommit mentioned in the previous comment. In that commit, there is anid_tableinad193x-i2c.c.ad193x.cdoesn't have anof_match_table, which makes sense because I'm trying to load the I2C device.
The ad1936 drivers does not have devicetree support, this is why it does not have a of_match_table.
Quoted 7 lines
I see now that
of_match_tableis distinct from theid_table. I assumed the I2C bus would walk the i2c_driver'sid_tableand load it that way.How should this work, then? Should I specify the same "everest,es8328" compatible array to both the I2C and the SPI driver, and let the different buses sort it out?
Yes.
Quoted 2 lines
Also, for my own curiosity, what is the difference between the I2C
id_tableand the generic driverof_match_table?
One is used for matching devices that are registered via the devicetree and the other is used for matching devices that have been registered via the in-kernel APIs, e.g. i2c_register_board_info (It can also match devices registered via the devicetree, but does not take the vendor prefix into account). The reason why there are two ways to match a device is mostly history and there are some efforts in progress to unify this.
- :ars
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 53A029A4.1020304-Qo5EllUWu/[email protected]
Re: [alsa-devel] [PATCH v3 1/2] ASoC: add es8328 codec driver
Quoted 234 lines · Lars-Peter Clausen
Quoted 218 lines · Sean Cross
Quoted 209 lines · Charles Keepax
Quoted 27 lines · Sean Cross
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
Signed-off-by Sean Cross <[email protected]>--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/es8328.txt
create mode 100644sound/soc/codecs/es8328-i2c.ccreate mode 100644sound/soc/codecs/es8328-spi.ccreate mode 100644sound/soc/codecs/es8328.ccreate mode 100644sound/soc/codecs/es8328.hDocumentation/devicetree/bindings/sound/es8328.txt new file +0
-0Documentation/devicetree/bindings/sound/es8328.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +8
-0@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328"I suspect the vendor prefix will be mandatory.
Quoted 171 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +10
-0+ + - reg : the I2C address of the device for I2C, the chip select + number for SPI. + +Example: + +codec: es8328@11 { + compatible = "es8328"; + reg = <0x11>; +};sound/soc/codecs/Kconfig +13
-0@@ -56,6 +56,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_DA732X if I2C select SND_SOC_DA9055 if I2C select SND_SOC_BT_SCO + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_ES8328_I2C if I2C select SND_SOC_ISABELLE if I2C select SND_SOC_JZ4740_CODEC select SND_SOC_LM4857 if I2C@@ -396,6 +398,17 @@ config SND_SOC_DMIC config SND_SOC_HDMI_CODEC tristate "HDMI stub CODEC" +config SND_SOC_ES8328 + tristate "Everest Semi ES8328 CODEC" + +config SND_SOC_ES8328_I2C + tristate + select SND_SOC_ES8328 + +config SND_SOC_ES8328_SPI + tristate + select SND_SOC_ES8328 + config SND_SOC_ISABELLE tristatesound/soc/codecs/Makefile +3
-0@@ -48,6 +48,9 @@ snd-soc-da732x-objs := da732x.o snd-soc-da9055-objs := da9055.o snd-soc-bt-sco-objs := bt-sco.o snd-soc-dmic-objs := dmic.o +snd-soc-es8328-objs := es8328.o +snd-soc-es8328-i2c-objs := es8328-i2c.o +snd-soc-es8328-spi-objs := es8328-spi.o snd-soc-isabelle-objs := isabelle.o snd-soc-jz4740-codec-objs := jz4740.o snd-soc-l3-objs := l3.o@@ -213,6 +216,9 @@ obj-$(CONFIG_SND_SOC_DA732X) +=snd-soc-da732x.o
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o
obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.osound/soc/codecs/Makefile +3
-0+obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o +obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o +obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.osound/soc/codecs/es8328-i2c.c new file +8
-0@@ -0,0 +1,55 @@ +/* +* es8328-i2c.c -- ES8328 ALSA SoC I2C Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */sound/soc/codecs/es8328-i2c.c new file +22
-0+ +#include <linux/module.h> +#include <linux/i2c.h> +#include <linux/regmap.h> + +#include <sound/soc.h> + +#include "es8328.h" + +static const struct i2c_device_id es8328_id[] = { + {"es8328" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, es8328_id); + +static int es8328_i2c_probe (struct i2c_client *i2c, +const struct i2c_device_id *id) +{ +struct regmap_config config; + + config = es8328_regmap_config; + return es8328_probe(&i2c->dev, devm_regmap_init_i2c(i2c,&config));
sound/soc/codecs/es8328-i2c.c new file +22
-0+} + +static int es8328_i2c_remove (struct i2c_client *i2c) +{ +snd_soc_unregister_codec (&i2c->dev); +return 0 ; +} + +static struct i2c_driver es8328_i2c_driver = { + .driver = { + .name ="es8328" , + }, + .probe = es8328_i2c_probe, + .remove = es8328_i2c_remove, + .id_table = es8328_id, +}; + +module_i2c_driver (es8328_i2c_driver); + +MODULE_DESCRIPTION ("ASoC ES8328 audio CODEC I2C driver" ); +MODULE_AUTHOR ("Sean Cross <[email protected]>" ); +MODULE_LICENSE ("GPL" );sound/soc/codecs/es8328-spi.c new file +8
-0@@ -0,0 +1,44 @@ +/* +* es8328.c -- ES8328 ALSA SoC SPI Audio driver +* +* Copyright 2014 Sutajio Ko-Usagi PTE LTD +* +* Author: Sean Cross <[email protected]> +* +* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */sound/soc/codecs/es8328-spi.c new file +13
-0+ +#include <linux/module.h> +#include <linux/regmap.h> +#include <linux/spi/spi.h> +#include <sound/soc.h> +#include "es8328.h" + +static int es8328_spi_probe (struct spi_device *spi) +{ +struct regmap_config config; + + config = es8328_regmap_config; + return es8328_probe(&spi->dev, devm_regmap_init_spi(spi,&config));
sound/soc/codecs/es8328-spi.c new file +10
-0+} + +static int es8328_spi_remove (struct spi_device *spi) +{ +snd_soc_unregister_codec (&spi->dev); +return 0 ; +} + +static struct spi_driver es8328_spi_driver = { + .driver = {Quoted 8 lines
sound/soc/codecs/es8328-spi.c
Quoted 5 lines
sound/soc/codecs/es8328-spi.c new file +5
-0+ .name = "es8328", + }, + .probe = es8328_spi_probe, + .remove = es8328_spi_remove, +};Your
of_match_tableseems to have gone missing since the last version I suspect that is why you had trouble with the vendor prefix. Ditto for the I2C as well.Quoted 4 lines
I was basing the driver off the
6c3d713e6d32706999689e379a9098afb4cd8a2ccommit mentioned in the previous comment. In that commit, there is anid_tableinad193x-i2c.c.ad193x.cdoesn't have anof_match_table, which makes sense because I'm trying to load the I2C device.The ad1936 drivers does not have devicetree support, this is why it does not have a
of_match_table.Quoted 7 lines
I see now that
of_match_tableis distinct from theid_table. I assumed the I2C bus would walk the i2c_driver'sid_tableand load it that way.How should this work, then? Should I specify the same "everest,es8328" compatible array to both the I2C and the SPI driver, and let the different buses sort it out?
Quoted 7 lines
Yes.
Quoted 2 lines
Also, for my own curiosity, what is the difference between the I2C
id_tableand the generic driverof_match_table?One is used for matching devices that are registered via the devicetree and the other is used for matching devices that have been registered via the in-kernel APIs, e.g.
i2c_register_board_info(It can also match devices registered via the devicetree, but does not take the vendor prefix into account). The reason why there are two ways to match a device is mostly history and there are some efforts in progress to unify this.
adding to the above explanation [0] will give example for DT and NON-DT supported platforms.
Quoted 2 lines
- :ars
[0] : http://stackoverflow.com/questions/19244847/from-where-platform-device-gets-it-name
Thanks,
Varka Bhadram
-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]
This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [alsa-devel] [PATCH v3 1/2] ASoC: add es8328 codec driver
In reply to a message not in the archiveQuoted 20 lines · Charles Keepax
Quoted 19 lines · Sean Cross
Add a codec driver for the Everest ES8328. It supports two separate audio outputs and two separate audio inputs.
Signed-off-by Sean Cross <[email protected]>--- Documentation/devicetree/bindings/sound/es8328.txt | 18 + sound/soc/codecs/Kconfig | 13 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/es8328-i2c.c | 55 ++ sound/soc/codecs/es8328-spi.c | 44 ++ sound/soc/codecs/es8328.c | 625 +++++++++++++++++++++ sound/soc/codecs/es8328.h | 313 +++++++++++ 7 files changed, 1074 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/es8328.txt create mode 100644 sound/soc/codecs/es8328-i2c.c create mode 100644 sound/soc/codecs/es8328-spi.c create mode 100644 sound/soc/codecs/es8328.c create mode 100644 sound/soc/codecs/es8328.h
Quoted 16 lines
Quoted 6 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +0
-0Documentation/devicetree/bindings/sound/es8328.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/sound/es8328.txt new file +8
-0@@ -0,0 +1,18 @@ +Everest ES8328 audio CODEC + +This device supports both I2C and SPI (configured with pin strapping +on the board). + +Required properties: + + - compatible : "es8328"I suspect the vendor prefix will be mandatory.
Yes.
There doesn't seem to be a prefix for Everest in vendor-prefixes.txt, Sean could you please add one as part of this series?
Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 2/2 ASoC: fsl: add imx-es8328 machine driver
In reply to a message not in the archiveThis adds an initial machine driver for the ES8328 audio codec. The driver supports headphones, an audio regulator for both the codec itself and a speaker amp, and supports reparenting and adjusting clocks to supply the audio codec with the unusual frequency it requires.
--- .../devicetree/bindings/sound/imx-audio-es8328.txt | 60 ++++ sound/soc/fsl/Kconfig | 14 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/imx-es8328.c | 359 +++++++++++++++++++++ 4 files changed, 435 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-es8328.txt create mode 100644 sound/soc/fsl/imx-es8328.c
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt new file +60 -0
@@ -0,0 +1,60 @@ +Freescale i.MX audio complex with ES8328 codec + +Required properties: +- compatible : "fsl,imx-audio-es8328" +- model : The user-visible name of this sound complex +- clocks : A list of clocks required to run the codec at 22.5792 MHz +- ssi-controller : The phandle of the i.MX SSI controller +- jack-gpio : Optional GPIO for headphone jack +- codec-supply : Power regulator for audio codec chip +- audio-amp-supply : Power regulator for speaker amps +- audio-codec : The phandle of the ES8328 audio codec +- audio-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. Valid names could be power + supplies, ES8328 pins, and the jacks on the board: + + Power supplies: + * audio-amp + * codec + + ES8328 pins: + * LOUT1 + * LOUT2 + * ROUT1 + * ROUT2 + + Board connectors: + * Headphone + * Speaker + +- mux-int-port : The internal port of the i.MX audio muxer (AUDMUX) +- mux-ext-port : The external port of the i.MX audio muxer + +Note: The AUDMUX port numbering should start at 1, which is consistent with +hardware manual. + +Example: + +sound { + compatible = "fsl,imx-audio-es8328"; + model = "imx-audio-es8328"; + clocks = <&clks 169>, <&clks 57>, <&clks 173>, + <&clks 203>, <&clks 201>; + clock-names = "cko1", "cko1_sel", "pll4_audio", + "pll4_post_div", "cko_sel"; + ssi-controller = <&ssi1>; + audio-codec = <&codec>; + jack-gpio = <&gpio5 15 0>; + codec-supply = <®_audio_codec>; + audio-amp-supply = <®_audio_amp>; + audio-routing = + "Speaker", "LOUT2", + "Speaker", "ROUT2", + "Speaker", "audio-amp", + "Headphone", "ROUT1", + "Headphone", "LOUT1"; + mux-int-port = <1>; + mux-ext-port = <3>; +}; +
sound/soc/fsl/Kconfig +14 -0
@@ -229,6 +229,20 @@ config SND_SOC_IMX_WM8962 Say Y if you want to add support for SoC audio on an i.MX board with a wm8962 codec. +config SND_SOC_IMX_ES8328 + tristate "SoC Audio support for i.MX boards with the ES8328 codec" + depends on OF && (I2C || SPI) + select SND_SOC_ES8328_I2C if I2C + select SND_SOC_ES8328_SPI if SPI_MASTER + select SND_SOC_IMX_PCM_DMA + select SND_SOC_IMX_AUDMUX + select SND_SOC_FSL_SSI + select SND_SOC_FSL_UTILS + select SND_SOC_IMX_PCM_FIQ + help + Say Y if you want to add support for the ES8328 audio codec connected + via SSI/I2S over either SPI or I2C. + config SND_SOC_IMX_SGTL5000 tristate "SoC Audio support for i.MX boards with sgtl5000" depends on OF && I2C
sound/soc/fsl/Makefile +2 -0
@@ -48,6 +48,7 @@ snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o snd-soc-phycore-ac97-objs := phycore-ac97.o snd-soc-mx27vis-aic32x4-objs := mx27vis-aic32x4.o snd-soc-wm1133-ev1-objs := wm1133-ev1.o +snd-soc-imx-es8328-objs := imx-es8328.o snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o snd-soc-imx-wm8962-objs := imx-wm8962.o snd-soc-imx-spdif-objs := imx-spdif.o
@@ -57,6 +58,7 @@ obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o obj-$(CONFIG_SND_SOC_PHYCORE_AC97) += snd-soc-phycore-ac97.o obj-$(CONFIG_SND_SOC_MX27VIS_AIC32X4) += snd-soc-mx27vis-aic32x4.o obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o +obj-$(CONFIG_SND_SOC_IMX_ES8328) += snd-soc-imx-es8328.o obj-$(CONFIG_SND_SOC_IMX_SGTL5000) += snd-soc-imx-sgtl5000.o obj-$(CONFIG_SND_SOC_IMX_WM8962) += snd-soc-imx-wm8962.o obj-$(CONFIG_SND_SOC_IMX_SPDIF) += snd-soc-imx-spdif.o
sound/soc/fsl/imx-es8328.c new file +359 -0
359 lines not on this page · raw message
Signature · 6 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1402997571-1255-3-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org
Re: [PATCH v3 2/2] ASoC: fsl: add imx-es8328 machine driver
Quoted 21 lines · Sean Cross
This adds an initial machine driver for the ES8328 audio codec. The driver supports headphones, an audio regulator for both the codec itself and a speaker amp, and supports reparenting and adjusting clocks to supply the audio codec with the unusual frequency it requires.
Signed-off-by Sean Cross <[email protected]>--- .../devicetree/bindings/sound/imx-audio-es8328.txt | 60 ++++ sound/soc/fsl/Kconfig | 14 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/imx-es8328.c | 359 +++++++++++++++++++++ 4 files changed, 435 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-es8328.txt create mode 100644 sound/soc/fsl/imx-es8328.cDocumentation/devicetree/bindings/sound/imx-audio-es8328.txt new file +0
-0
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt new file +6
-0@@ -0,0 +1,60 @@ +Freescale i.MX audio complex with ES8328 codec + +Required properties: +- compatible : "fsl,imx-audio-es8328" +- model : The user-visible name of this sound complex +- clocks : A list of clocks required to run the codec at 22.5792 MHz
The driver seems to acquire these by name.
Please document the names you expect.
[...]
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt line 17
Quoted 11 lines
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt new file +11
-0+static int imx_es8328_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct device_node *ssi_np, *codec_np; + struct platform_device *ssi_pdev; + struct imx_es8328_data *data; + int int_port, ext_port; + int ret; + struct device *dev = &pdev->dev; + + ret = of_property_read_u32(np, "mux-int-port", &int_port);
I see int_port is defined as an int; please make it a u32 to match the prototype of of_property_read_u32.
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt line 26
Quoted 9 lines
Documentation/devicetree/bindings/sound/imx-audio-es8328.txt new file +9
-0+ if (ret) { + dev_err(&pdev->dev, "mux-int-port missing or invalid\n"); + return ret; + } + ret = of_property_read_u32(np, "mux-ext-port", &ext_port); + if (ret) { + dev_err(&pdev->dev, "mux-ext-port missing or invalid\n"); + return ret; + }
As with int_port, please define ext_port as a u32.
Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html