[PATCH v2] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev

2020-09-01 Thread Camel Guo
From: Camel Guo In adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Signed-off-by: Camel Guo --- sound/soc/codecs/tlv320adcx140.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/so

[PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev

2020-09-01 Thread Camel Guo
From: Camel Guo In adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Fixes: 689c7655b50c ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family") Signed-off-by: Camel Guo --- sound/soc/codecs/tlv320adcx140.c | 4 +++- 1

[PATCH v3] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev

2020-09-01 Thread Camel Guo
From: Camel Guo In adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Fixes: 689c7655b50c ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family") Signed-off-by: Camel Guo --- sound/soc/codecs/tlv320adcx140.c | 4 +++- 1

[PATCH v4] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev

2020-09-01 Thread Camel Guo
From: Camel Guo In adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Fixes: 689c7655b50c ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family") Acked-by: Dan Murphy Signed-off-by: Camel Guo --- v4: - Add Acked-By

[PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized abcx140->dev

2020-09-01 Thread Camel Guo
From: Camel Guo in adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Signed-off-by: Camel Guo --- sound/soc/codecs/tlv320adcx140.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/so

[PATCH 2/2] ASoC: tlv320adcx140: Wake up codec before accessing register

2020-09-08 Thread Camel Guo
From: Camel Guo According to its datasheet, after reset this codec goes into sleep mode. In this mode, any register accessing should be avoided except for exiting sleep mode. Hence this commit moves SLEEP_CFG access before any register accessing. Signed-off-by: Camel Guo --- sound/soc/codecs

[PATCH 1/2] ASoC: tlv320adcx140: Avoid accessing invalid gpio_reset

2020-09-08 Thread Camel Guo
From: Camel Guo When gpio_reset is not well defined in devicetree, the adcx140->gpio_reset is an error code instead of NULL. In this case, adcx140->gpio_reset should not be used by adcx140_reset. This commit sets it NULL to avoid accessing an invalid variable. Signed-off-by: Cam

[PATCH] ASoC: tlv320adcx140: Fix digital gain range

2020-09-08 Thread Camel Guo
From: Camel Guo According to its datasheet, the digital gain should be -100 dB when CHx_DVOL is 1 and 27 dB when CHx_DVOL is 255. But with the current dig_vol_tlv, "Digital CHx Out Volume" shows 27.5 dB if CHx_DVOL is 255 and -95.5 dB if CHx_DVOL is 1. This commit fixes this b

[PATCH] ASoC: tlv320adcx140: Add support for master mode

2020-09-08 Thread Camel Guo
From: Camel Guo Add setup of bclk-to-ws ratio and sample rate when in master mode, as well as MCLK input pin setup. Limitations: - MCLK is assumed to be connected to GPIO1 (other possible choices would be GPI0..3 if they weren't used for analog positive inputs). - PLL is always enabled

Re: [PATCH 1/2] ASoC: tlv320adcx140: Avoid accessing invalid gpio_reset

2020-09-09 Thread Camel Guo
Mark On 9/8/20 7:20 PM, Mark Brown wrote: On Tue, 8 Sep 2020 10:35:20 +0200, Camel Guo wrote: When gpio_reset is not well defined in devicetree, the adcx140->gpio_reset is an error code instead of NULL. In this case, adcx140->gpio_reset should not be used by adcx140_reset. This commit s

Re: [PATCH 1/2] ASoC: tlv320adcx140: Avoid accessing invalid gpio_reset

2020-09-09 Thread Camel Guo
Hi Peter, Thanks for your comment. I will make a new one like what you said. On 9/8/20 2:03 PM, Peter Ujfalusi wrote: Hi, On 08/09/2020 14.59, Peter Ujfalusi wrote: On 08/09/2020 11.35, Camel Guo wrote: From: Camel Guo When gpio_reset is not well defined in devicetree, the adcx140

[PATCH v2 1/3] dt-bindings: tlv320adcx140: Add GPIO config and drive config

2020-09-11 Thread Camel Guo
From: Camel Guo Add properties for configuring the General Purpose Input Outputs (GPIO). There are 2 settings for GPIO, configuration and the output drive type. Signed-off-by: Camel Guo --- .../bindings/sound/tlv320adcx140.yaml | 44 +++ 1 file changed, 44 insertions

[PATCH v2 2/3] ASoC: tlv320adcx140: Add support for configuring GPIO pin

2020-09-11 Thread Camel Guo
From: Camel Guo Add support to configure the GPIO pin to the specific configuration. The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN, GPI, MCLK, SDIN, PDMDIN1, PDMDIN2, PDMDIN3 or PDMDIN4 and the output drive can be configured with various configuration. Signed-off-by

[PATCH v2 3/3] ASoC: tlv320adcx140: Add proper support for master mode

2020-09-11 Thread Camel Guo
From: Camel Guo Add setup of bclk-to-ws ratio and sample rate when in master mode, as well as MCLK input pin setup. Signed-off-by: Camel Guo --- v2: - Move GPIO setting into devicetree - Move master config register setting into a new function sound/soc/codecs/tlv320adcx140.c | 139

[PATCH v4] ASoC: tlv320adcx140: Add support for configuring GPIO pin

2020-09-18 Thread Camel Guo
From: Camel Guo Add support to configure the GPIO pin to the specific configuration. The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN, GPI, MCLK, SDIN, PDMDIN1, PDMDIN2, PDMDIN3 or PDMDIN4 and the output drive can be configured with various configuration. Signed-off-by

[PATCH v4 1/2] dt-bindings: tlv320adcx140: Add GPIO config and drive config

2020-09-18 Thread Camel Guo
From: Camel Guo Add properties for configuring the General Purpose Input Output (GPIO). There are 2 settings for GPIO, configuration and the output drive type. Signed-off-by: Camel Guo Acked-by: Dan Murphy --- v4: - Rebase v3: - Fix typo - Add Acked-By from Dan .../bindings/sound

Re: [PATCH v4] ASoC: tlv320adcx140: Add support for configuring GPIO pin

2020-09-18 Thread Camel Guo
Mark On 9/18/20 1:18 PM, Mark Brown wrote: On Fri, Sep 18, 2020 at 09:32:29AM +0200, Camel Guo wrote: From: Camel Guo Add support to configure the GPIO pin to the specific configuration. The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN, GPI, MCLK, SDIN, PDMDIN1, PDMDIN2

[PATCH v5 1/2] dt-bindings: tlv320adcx140: Add GPIO config and drive config

2020-09-18 Thread Camel Guo
From: Camel Guo Add properties for configuring the General Purpose Input Output (GPIO). There are 2 settings for GPIO, configuration and the output drive type. Signed-off-by: Camel Guo Acked-by: Dan Murphy --- v4: - Rebase v3: - Fix typo - Add Acked-By from Dan .../bindings/sound

[PATCH v5 2/2] ASoC: tlv320adcx140: Add support for configuring GPIO pin

2020-09-18 Thread Camel Guo
From: Camel Guo Add support to configure the GPIO pin to the specific configuration. The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN, GPI, MCLK, SDIN, PDMDIN1, PDMDIN2, PDMDIN3 or PDMDIN4 and the output drive can be configured with various configuration. Signed-off-by

Re: [PATCH v2 3/3] ASoC: tlv320adcx140: Add proper support for master mode

2020-09-16 Thread Camel Guo
Please forget about this patch since Dan will upload a similar one. @Dan, see my comment below. On 9/15/20 8:50 PM, Dan Murphy wrote: Camel On 9/11/20 3:07 AM, Camel Guo wrote: From: Camel Guo Add setup of bclk-to-ws ratio and sample rate when in master mode, as well as MCLK input pin

[PATCH v3 2/2] ASoC: tlv320adcx140: Add support for configuring GPIO pin

2020-09-16 Thread Camel Guo
From: Camel Guo Add support to configure the GPIO pin to the specific configuration. The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN, GPI, MCLK, SDIN, PDMDIN1, PDMDIN2, PDMDIN3 or PDMDIN4 and the output drive can be configured with various configuration. Signed-off-by

[PATCH v3 1/2] dt-bindings: tlv320adcx140: Add GPIO config and drive config

2020-09-16 Thread Camel Guo
From: Camel Guo Add properties for configuring the General Purpose Input Output (GPIO). There are 2 settings for GPIO, configuration and the output drive type. Signed-off-by: Camel Guo Acked-by: Dan Murphy --- v3: - Fix typo - Add Acked-By from Dan .../bindings/sound/tlv320adcx140.yaml