ASoC: add driver support for Conexant CX2092X DSP
Subsystems (3)
v3 cover ASoC: add driver support for Conexant CX2092X DSP
From: Simon Ho <[email protected]>
Hi Mark, Takashi
I corrected the driver based on your input as below.
- GPIO specifier names have to be pluralised.
- Using gpiod_ instead of gpio APIs.
- Using cansleep () gpio version.
- Using cansleep () gpio version.
- Moving the driver information to patch description.
Thanks,
Simoon
Simon Ho (2):
doc: cx2092x: Add DT bingings doc for CX2092X DSP
ASoC: Add driver support fro Conexant CX2092X DSP
.../devicetree/bindings/sound/cnxt,cx2092x.txt | 29 ++ sound/soc/codecs/Kconfig | 17 + sound/soc/codecs/Makefile | 6 + sound/soc/codecs/cx2092x-i2c.c | 54 +++ sound/soc/codecs/cx2092x-spi.c | 57 +++ sound/soc/codecs/cx2092x.c | 411 +++++++++++++++++++++ sound/soc/codecs/cx2092x.h | 26 ++ 7 files changed, 600 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cnxt,cx2092x.txt create mode 100644 sound/soc/codecs/cx2092x-i2c.c create mode 100644 sound/soc/codecs/cx2092x-spi.c create mode 100644 sound/soc/codecs/cx2092x.c create mode 100644 sound/soc/codecs/cx2092x.h
Signature · 1 line
2.7.4
PATCH v3 1/2 doc: cx2092x: Add DT bingings doc for CX2092X DSP
From: Simon Ho <[email protected]>
Initial version of CX2092X device tree bindings document.
--- .../devicetree/bindings/sound/cnxt,cx2092x.txt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cnxt,cx2092x.txt
Documentation/devicetree/bindings/sound/cnxt,cx2092x.txt new file +29 -0
@@ -0,0 +1,29 @@ +Conexant CX20921/CX209724 Voice Processor DSP + +The devices supports both the I2C and SPI bus. + +Required properties: + + - compatible: One of "cnxt,cx20921", "cnxt,cx20924". + - reg: The I2C address of the device for I2C, it should be <0x41> + +Optional properties: + + - reset-gpios: A GPIO spec to define which pin is connected to the chip's + !RESET pin. If specified, the driver will assert a hardware + reset at probe time. + +CODEC input pins: + "MIC" - Microphone input + +Example: + +codec_i2c: cx20921@41 { + compatible = "cnxt,cx20921"; + reg = <0x41>; + reset-gpios = <&gpio1 23 0>; +}; + +codec_spi: cx20924@0 { + compatible = "cnxt,cx20924"; +};
Signature · 1 line
2.7.4
PATCH v3 2/2 ASoC: Add driver support fro Conexant CX2092X DSP
In reply to [email protected]From: Simon Ho <[email protected]>
Initial commit of Conexant CX20921/CX20924 I2S Audio DSP driver
The CX2092X devices are designed for virtual assisant application need to be always open, listening for users to summon it. There is no any power saving mode support on this device. The processed voice data will be sent to automatic speech recognition (ASR) application for further processing.
--- sound/soc/codecs/Kconfig | 17 ++ sound/soc/codecs/Makefile | 6 + sound/soc/codecs/cx2092x-i2c.c | 54 ++++++ sound/soc/codecs/cx2092x-spi.c | 57 ++++++ sound/soc/codecs/cx2092x.c | 411 +++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/cx2092x.h | 26 +++ 6 files changed, 571 insertions(+) create mode 100644 sound/soc/codecs/cx2092x-i2c.c create mode 100644 sound/soc/codecs/cx2092x-spi.c create mode 100644 sound/soc/codecs/cx2092x.c create mode 100644 sound/soc/codecs/cx2092x.h
sound/soc/codecs/Kconfig +17 -0
@@ -63,6 +63,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_CS47L24 if MFD_CS47L24 select SND_SOC_CS53L30 if I2C select SND_SOC_CX20442 if TTY + select SND_SOC_CX2092X_I2C if I2C + select SND_SOC_CX2092X_SPI if SPI_MASTER select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI select SND_SOC_DA7213 if I2C select SND_SOC_DA7218 if I2C
@@ -491,6 +493,21 @@ config SND_SOC_CX20442 tristate depends on TTY +config SND_SOC_CX2092X + tristate + +config SND_SOC_CX2092X_I2C + tristate "Conexant CX20921/CX2094 CODEC (I2C)" + depends on I2C + select SND_SOC_CX2092X + select REGMAP_I2C + +config SND_SOC_CX2092X_SPI + tristate "Conexant CX20921/CX2094 CODEC (SPI)" + depends on SPI_MASTER + select SND_SOC_CX2092X + select REGMAP_SPI + config SND_SOC_JZ4740_CODEC select REGMAP_MMIO tristate
sound/soc/codecs/Makefile +6 -0
@@ -56,6 +56,9 @@ snd-soc-cs4349-objs := cs4349.o snd-soc-cs47l24-objs := cs47l24.o snd-soc-cs53l30-objs := cs53l30.o snd-soc-cx20442-objs := cx20442.o +snd-soc-cx2092x-objs := cx2092x.o +snd-soc-cx2092x-i2c-objs := cx2092x-i2c.o +snd-soc-cx2092x-spi-objs := cx2092x-spi.o snd-soc-da7210-objs := da7210.o snd-soc-da7213-objs := da7213.o snd-soc-da7218-objs := da7218.o
@@ -286,6 +289,9 @@ obj-$(CONFIG_SND_SOC_CS4349) += snd-soc-cs4349.o obj-$(CONFIG_SND_SOC_CS47L24) += snd-soc-cs47l24.o obj-$(CONFIG_SND_SOC_CS53L30) += snd-soc-cs53l30.o obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o +obj-$(CONFIG_SND_SOC_CX2092X) += snd-soc-cx2092x.o +obj-$(CONFIG_SND_SOC_CX2092X_I2C) += snd-soc-cx2092x-i2c.o +obj-$(CONFIG_SND_SOC_CX2092X_SPI) += snd-soc-cx2092x-spi.o obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o obj-$(CONFIG_SND_SOC_DA7213) += snd-soc-da7213.o obj-$(CONFIG_SND_SOC_DA7218) += snd-soc-da7218.o
sound/soc/codecs/cx2092x-i2c.c new file +54 -0
54 lines not on this page · raw message
sound/soc/codecs/cx2092x-spi.c new file +57 -0
57 lines not on this page · raw message
sound/soc/codecs/cx2092x.c new file +411 -0
411 lines not on this page · raw message
sound/soc/codecs/cx2092x.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* cx2092x.h -- CX20921 and CX20924 Audio driver +* +* Copyright: (C) 2017 Conexant Systems, Inc. +* +* This is based on Alexander Sverdlin's CS4271 driver code. +* +* 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. +* +*/ + +#ifndef __CX2092X_PRIV_H__ +#define __CX2092X_PRIV_H__ + +#include <linux/regmap.h> + +extern const struct of_device_id cx2092x_dt_ids[]; +extern const struct regmap_config cx2092x_regmap_config; + +int cx2092x_dev_probe (struct device *dev,struct regmap *regmap); + +#define CX2092X_REG_MAX 0x2000 + +#endif
Signature · 1 line
2.7.4
kbuild test robot
build bot[PATCH] ASoC: fix platform_no_drv_owner.cocci warnings
sound/soc/codecs/cx2092x-i2c.c:43:3-8: No need to set .owner here. The core will do it.
sound/soc/codecs/cx2092x-i2c.c:43:3-8: No need to set .owner here. The core will do it.
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
---
cx2092x-i2c.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/codecs/cx2092x-i2c.c +0 -1
@@ -40,7 +40,6 @@ MODULE_DEVICE_TABLE(i2c, cx2092x_i2c_id)static struct i2c_driver cx2092x_i2c_driver = { .driver = { .name ="cx2092x" , - .owner =THIS_MODULE , .of_match_table =of_match_ptr (cx2092x_dt_ids), }, .id_table = cx2092x_i2c_id,
kbuild test robot
build botRe: [alsa_devel] [PATCH v3 2/2] ASoC: Add driver support fro Conexant CX2092X DSP
In reply to [email protected]coccinelle warnings: (new ones prefixed by >>)
Hi Simon,
[auto build test WARNING on asoc/for-next]
[also build test WARNING on v4.10 next-20170220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/simon-ho-cnxt-gmail-com/ASoC-add-driver-support-for-Conexant-CX2092X-DSP/20170221-235253 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
coccinelle warnings: (new ones prefixed by >>)
>> sound/soc/codecs/cx2092x-i2c.c:43:3-8: No need to set .owner here. The core will do it.
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation