Add support for Wolfson WM8998 and WM1814 codecs
Subsystems (8)
PATCH 1/8 mfd: arizona: Split INx_MODE into two fields
In reply to Richard FitzgeraldLater arizona silicon has the single/differential selector in a different register, and IN1_MODE only selects between analogue or digital. Prepare for this by splitting the INx_MODE definition into two fields.
--- drivers/mfd/arizona-core.c | 8 ++++++-- include/linux/mfd/arizona/pdata.h | 5 ++++- include/linux/mfd/arizona/registers.h | 27 ++++++++++++++++++--------- 3 files changed, 28 insertions(+), 12 deletions(-)
drivers/mfd/arizona-core.c +6 -2
@@ -977,12 +977,16 @@ int arizona_dev_init(struct arizona *arizona)/* Default for both is 0 so noop with defaults */ val = arizona->pdata.dmic_ref[i] <<ARIZONA_IN1_DMIC_SUP_SHIFT ; - val |= arizona->pdata.inmode[i] <<ARIZONA_IN1_MODE_SHIFT ; + val |= (arizona->pdata.inmode[i] &2 ) + << (ARIZONA_IN1_MODE_SHIFT -1 ); + val |= (arizona->pdata.inmode[i] &1 ) + <<ARIZONA_IN1_SINGLE_ENDED_SHIFT ;regmap_update_bits (arizona->regmap,ARIZONA_IN1L_CONTROL + (i *8 ),ARIZONA_IN1_DMIC_SUP_MASK | -ARIZONA_IN1_MODE_MASK , val); +ARIZONA_IN1_MODE_MASK | +ARIZONA_IN1_SINGLE_ENDED_MASK , val); }for (i =0 ; i <ARIZONA_MAX_OUTPUT ; i++) {
include/linux/mfd/arizona/pdata.h +4 -1
@@ -156,7 +156,10 @@ struct arizona_pdata {/** MICBIAS configurations */ struct arizona_micbias micbias[ARIZONA_MAX_MICBIAS ]; -/** Mode of input structures */ +/** +* Mode of input structures +* One of the ARIZONA_INMODE_xxx values +*/ int inmode[ARIZONA_MAX_INPUT ];/** Mode for outputs */
include/linux/mfd/arizona/registers.h +18 -9
@@ -2515,9 +2515,12 @@#define ARIZONA_IN1_DMIC_SUP_MASK 0x1800/* IN1_DMIC_SUP - [12:11] */ #define ARIZONA_IN1_DMIC_SUP_SHIFT 11/* IN1_DMIC_SUP - [12:11] */ #define ARIZONA_IN1_DMIC_SUP_WIDTH 2/* IN1_DMIC_SUP - [12:11] */ -#define ARIZONA_IN1_MODE_MASK 0x0600/* IN1_MODE - [10:9] */ -#define ARIZONA_IN1_MODE_SHIFT 9/* IN1_MODE - [10:9] */ -#define ARIZONA_IN1_MODE_WIDTH 2/* IN1_MODE - [10:9] */ +#define ARIZONA_IN1_MODE_MASK 0x0400/* IN1_MODE - [10] */ +#define ARIZONA_IN1_MODE_SHIFT 10/* IN1_MODE - [10] */ +#define ARIZONA_IN1_MODE_WIDTH 1/* IN1_MODE - [10] */ +#define ARIZONA_IN1_SINGLE_ENDED_MASK 0x0200/* IN1_MODE - [9] */ +#define ARIZONA_IN1_SINGLE_ENDED_SHIFT 9/* IN1_MODE - [9] */ +#define ARIZONA_IN1_SINGLE_ENDED_WIDTH 1/* IN1_MODE - [9] */ #define ARIZONA_IN1L_PGA_VOL_MASK 0x00FE/* IN1L_PGA_VOL - [7:1] */ #define ARIZONA_IN1L_PGA_VOL_SHIFT 1/* IN1L_PGA_VOL - [7:1] */ #define ARIZONA_IN1L_PGA_VOL_WIDTH 7/* IN1L_PGA_VOL - [7:1] */
@@ -2588,9 +2591,12 @@#define ARIZONA_IN2_DMIC_SUP_MASK 0x1800/* IN2_DMIC_SUP - [12:11] */ #define ARIZONA_IN2_DMIC_SUP_SHIFT 11/* IN2_DMIC_SUP - [12:11] */ #define ARIZONA_IN2_DMIC_SUP_WIDTH 2/* IN2_DMIC_SUP - [12:11] */ -#define ARIZONA_IN2_MODE_MASK 0x0600/* IN2_MODE - [10:9] */ -#define ARIZONA_IN2_MODE_SHIFT 9/* IN2_MODE - [10:9] */ -#define ARIZONA_IN2_MODE_WIDTH 2/* IN2_MODE - [10:9] */ +#define ARIZONA_IN2_MODE_MASK 0x0400/* IN2_MODE - [10] */ +#define ARIZONA_IN2_MODE_SHIFT 10/* IN2_MODE - [10] */ +#define ARIZONA_IN2_MODE_WIDTH 1/* IN2_MODE - [10] */ +#define ARIZONA_IN2_SINGLE_ENDED_MASK 0x0200/* IN2_MODE - [9] */ +#define ARIZONA_IN2_SINGLE_ENDED_SHIFT 9/* IN2_MODE - [9] */ +#define ARIZONA_IN2_SINGLE_ENDED_WIDTH 1/* IN2_MODE - [9] */ #define ARIZONA_IN2L_PGA_VOL_MASK 0x00FE/* IN2L_PGA_VOL - [7:1] */ #define ARIZONA_IN2L_PGA_VOL_SHIFT 1/* IN2L_PGA_VOL - [7:1] */ #define ARIZONA_IN2L_PGA_VOL_WIDTH 7/* IN2L_PGA_VOL - [7:1] */
@@ -2661,9 +2667,12 @@#define ARIZONA_IN3_DMIC_SUP_MASK 0x1800/* IN3_DMIC_SUP - [12:11] */ #define ARIZONA_IN3_DMIC_SUP_SHIFT 11/* IN3_DMIC_SUP - [12:11] */ #define ARIZONA_IN3_DMIC_SUP_WIDTH 2/* IN3_DMIC_SUP - [12:11] */ -#define ARIZONA_IN3_MODE_MASK 0x0600/* IN3_MODE - [10:9] */ -#define ARIZONA_IN3_MODE_SHIFT 9/* IN3_MODE - [10:9] */ -#define ARIZONA_IN3_MODE_WIDTH 2/* IN3_MODE - [10:9] */ +#define ARIZONA_IN3_MODE_MASK 0x0400/* IN3_MODE - [10] */ +#define ARIZONA_IN3_MODE_SHIFT 10/* IN3_MODE - [10] */ +#define ARIZONA_IN3_MODE_WIDTH 1/* IN3_MODE - [10] */ +#define ARIZONA_IN3_SINGLE_ENDED_MASK 0x0200/* IN3_MODE - [9] */ +#define ARIZONA_IN3_SINGLE_ENDED_SHIFT 9/* IN3_MODE - [9] */ +#define ARIZONA_IN3_SINGLE_ENDED_WIDTH 1/* IN3_MODE - [9] */ #define ARIZONA_IN3L_PGA_VOL_MASK 0x00FE/* IN3L_PGA_VOL - [7:1] */ #define ARIZONA_IN3L_PGA_VOL_SHIFT 1/* IN3L_PGA_VOL - [7:1] */ #define ARIZONA_IN3L_PGA_VOL_WIDTH 7/* IN3L_PGA_VOL - [7:1] */
Signature · 1 line
1.7.2.5
PATCH 2/8 ASoC: arizona: add defines for single-input gain control
In reply to Richard FitzgeraldAdds convenience defines for declaring a gain control that has an input mux. These block are functionally equivalent to the existing mixer blocks but only have a single input.
--- sound/soc/codecs/arizona.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
sound/soc/codecs/arizona.h +5 -0
@@ -92,6 +92,11 @@ extern const unsigned int arizona_mixer_tlv[];extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS ];extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS ]; +#define ARIZONA_GAINMUX_CONTROLS (name, base) \ + SOC_SINGLE_RANGE_TLV(name " Input Volume", base + 1, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv) +#define ARIZONA_MIXER_CONTROLS (name, base) \ SOC_SINGLE_RANGE_TLV(name " Input 1 Volume", base + 1, \ ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
Signature · 1 line
1.7.2.5
cover Add support for Wolfson WM8998 and WM1814 codecs
This set of patches adds support for the Wolfson Microelectronics WM8998 and WM1814 codecs.
Richard Fitzgerald (8):
mfd: arizona: Split INx_MODE into two fields
ASoC: arizona: add defines for single-input gain control
mfd: arizona: Add support for WM8998 and WM1814
gpio: arizona: add support for WM8998 and WM1814
regulator: arizona: add support for WM8998 and WM1814
extcon: arizona: Add support for WM8998 and WM1814
ASoC: wm8998: Initial WM8998 codec driver
Documentation: Add WM8998/WM1814 device tree bindings
Documentation/devicetree/bindings/mfd/arizona.txt | 3 + drivers/extcon/extcon-arizona.c | 33 +- drivers/gpio/gpio-arizona.c | 2 + drivers/mfd/Kconfig | 6 + drivers/mfd/Makefile | 3 + drivers/mfd/arizona-core.c | 106 ++- drivers/mfd/arizona-i2c.c | 8 + drivers/mfd/arizona-irq.c | 9 + drivers/mfd/arizona.h | 5 + drivers/mfd/wm8998-tables.c | 1592 +++++++++++++++++++++ drivers/regulator/arizona-ldo1.c | 2 + include/linux/mfd/arizona/core.h | 3 + include/linux/mfd/arizona/pdata.h | 5 +- include/linux/mfd/arizona/registers.h | 247 +++- sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/arizona.c | 7 + sound/soc/codecs/arizona.h | 7 +- sound/soc/codecs/wm8998.c | 1392 ++++++++++++++++++ sound/soc/codecs/wm8998.h | 23 + 20 files changed, 3432 insertions(+), 29 deletions(-) create mode 100644 drivers/mfd/wm8998-tables.c create mode 100644 sound/soc/codecs/wm8998.c create mode 100644 sound/soc/codecs/wm8998.h
Signature · 1 line
1.7.2.5
PATCH 5/8 regulator: arizona: add support for WM8998 and WM1814
--- drivers/regulator/arizona-ldo1.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/regulator/arizona-ldo1.c +2 -0
@@ -240,6 +240,8 @@ static int arizona_ldo1_probe(struct platform_device *pdev)switch (arizona->type) {case WM5102 :case WM8997 : +case WM8998 : +case WM1814 : desc = &arizona_ldo1_hc; ldo1->init_data = arizona_ldo1_dvfs;break ;
Signature · 1 line
1.7.2.5
PATCH 4/8 gpio: arizona: add support for WM8998 and WM1814
In reply to Richard Fitzgerald--- drivers/gpio/gpio-arizona.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpio/gpio-arizona.c +2 -0
@@ -118,6 +118,8 @@ static int arizona_gpio_probe(struct platform_device *pdev)case WM5110 :case WM8280 :case WM8997 : +case WM8998 : +case WM1814 : arizona_gpio->gpio_chip.ngpio =5 ;break ;default :
Signature · 1 line
1.7.2.5
PATCH 8/8 Documentation: Add WM8998/WM1814 device tree bindings
In reply to Richard Fitzgerald--- Documentation/devicetree/bindings/mfd/arizona.txt | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/mfd/arizona.txt +3 -0
@@ -10,6 +10,9 @@ Required properties: "wlf,wm5110" "wlf,wm8280" "wlf,wm8997" + "wlf,WM8998" + "wlf,wm1814" + - reg : I2C slave address when connected using I2C, chip select number when using SPI.
Signature · 1 line
1.7.2.5
PATCH 3/8 mfd: arizona: Add support for WM8998 and WM1814
In reply to Richard Fitzgerald--- drivers/mfd/Kconfig | 6 + drivers/mfd/Makefile | 3 + drivers/mfd/arizona-core.c | 106 ++- drivers/mfd/arizona-i2c.c | 8 + drivers/mfd/arizona-irq.c | 9 + drivers/mfd/arizona.h | 5 + drivers/mfd/wm8998-tables.c | 1592 +++++++++++++++++++++++++++++++++ include/linux/mfd/arizona/core.h | 3 + include/linux/mfd/arizona/registers.h | 220 +++++ 9 files changed, 1943 insertions(+), 9 deletions(-) create mode 100644 drivers/mfd/wm8998-tables.c
drivers/mfd/Kconfig +6 -0
@@ -1359,6 +1359,12 @@ config MFD_WM8997 help Support for Wolfson Microelectronics WM8997 low power audio SoC +config MFD_WM8998 + bool "Wolfson Microelectronics WM8998" + depends on MFD_ARIZONA + help + Support for Wolfson Microelectronics WM8998 low power audio SoC + config MFD_WM8400 bool "Wolfson Microelectronics WM8400" select MFD_CORE
drivers/mfd/Makefile +3 -0
@@ -50,6 +50,9 @@ endif ifneq ($(CONFIG_MFD_WM8997),n) obj-$(CONFIG_MFD_ARIZONA) += wm8997-tables.o endif +ifneq ($(CONFIG_MFD_WM8998),n) +obj-$(CONFIG_MFD_ARIZONA) += wm8998-tables.o +endif obj-$(CONFIG_MFD_WM8400) += wm8400-core.o wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o wm831x-objs += wm831x-auxadc.o
drivers/mfd/arizona-core.c +97 -9
175 lines not on this page · raw message
drivers/mfd/arizona-i2c.c +8 -0
@@ -53,6 +53,12 @@ static int arizona_i2c_probe(struct i2c_client *i2c, regmap_config = &wm8997_i2c_regmap;break ;#endif +#ifdef CONFIG_MFD_WM8998 +case WM8998 : +case WM1814 : + regmap_config = &wm8998_i2c_regmap; +break ; +#endif default :dev_err (&i2c->dev,"Unknown device type %ld\n" , id->driver_data);
@@ -90,6 +96,8 @@ static const struct i2c_device_id arizona_i2c_id[] = { { "wm5110", WM5110 }, { "wm8280", WM8280 }, { "wm8997", WM8997 }, + { "wm8998", WM8998 }, + { "wm1814", WM1814 }, { } };MODULE_DEVICE_TABLE (i2c, arizona_i2c_id);
drivers/mfd/arizona-irq.c +9 -0
@@ -234,6 +234,15 @@ int arizona_irq_init(struct arizona *arizona) arizona->ctrlif_error = false;break ;#endif +#ifdef CONFIG_MFD_WM8998 +case WM8998 : +case WM1814 : + aod = &wm8998_aod; + irq = &wm8998_irq; + + arizona->ctrlif_error = false; +break ; +#endif default :BUG_ON ("Unknown Arizona class device" ==NULL );return -EINVAL ;
drivers/mfd/arizona.h +5 -0
@@ -27,6 +27,8 @@ extern const struct regmap_config wm5110_spi_regmap;extern const struct regmap_config wm8997_i2c_regmap; +extern const struct regmap_config wm8998_i2c_regmap; +extern const struct dev_pm_ops arizona_pm_ops;extern const struct of_device_id arizona_of_match[];
@@ -41,6 +43,9 @@ extern const struct regmap_irq_chip wm5110_revd_irq;extern const struct regmap_irq_chip wm8997_aod;extern const struct regmap_irq_chip wm8997_irq; +extern struct regmap_irq_chip wm8998_aod; +extern struct regmap_irq_chip wm8998_irq; +int arizona_dev_init (struct arizona *arizona);int arizona_dev_exit (struct arizona *arizona);int arizona_irq_init (struct arizona *arizona);
drivers/mfd/wm8998-tables.c new file +1592 -0
1,592 lines not on this page · raw message
include/linux/mfd/arizona/core.h +3 -0
@@ -25,6 +25,8 @@ enum arizona_type {WM5110 =2 ,WM8997 =3 ,WM8280 =4 , +WM8998 =5 , + WM1814 = 6, };#define ARIZONA_IRQ_GP1 0
@@ -156,6 +158,7 @@ int arizona_set_irq_wake(struct arizona *arizona, int irq, int on);int wm5102_patch (struct arizona *arizona);int wm5110_patch (struct arizona *arizona);int wm8997_patch (struct arizona *arizona); +int wm8998_patch (struct arizona *arizona);extern int arizona_of_get_named_gpio (struct arizona *arizona,const char *prop,bool mandatory);
include/linux/mfd/arizona/registers.h +220 -0
329 lines not on this page · raw message
Signature · 1 line
1.7.2.5
PATCH 6/8 extcon: arizona: Add support for WM8998 and WM1814
In reply to Richard Fitzgerald--- drivers/extcon/extcon-arizona.c | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
drivers/extcon/extcon-arizona.c +22 -11
@@ -1,7 +1,7 @@/* * extcon-arizona.c - Extcon driver Wolfson Arizona devices * -* Copyright (C) 2012 Wolfson Microelectronics plc +* Copyright (C) 2012-2014 Wolfson Microelectronics plc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -140,10 +140,14 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info, bool clamp) {struct arizona *arizona = info->arizona; -unsigned int mask =0 , val =0 ; +unsigned int mask, val =0 ;int ret;switch (arizona->type) { +case WM8998 : +case WM1814 : + mask =0 ; +break ;case WM5110 : mask =ARIZONA_HP1L_SHRTO |ARIZONA_HP1L_FLWR |ARIZONA_HP1L_SHRTI ;
@@ -175,17 +179,19 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info, ret); } - ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1L , - mask, val); -if (ret !=0 ) -dev_warn (arizona->dev,"Failed to do clamp: %d\n" , +if (mask) { + ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1L , + mask, val); +if (ret !=0 ) +dev_warn (arizona->dev,"Failed to do clamp: %d\n" , ret); - ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1R , - mask, val); -if (ret !=0 ) -dev_warn (arizona->dev,"Failed to do clamp: %d\n" , - ret); + ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1R , + mask, val); +if (ret !=0 ) +dev_warn (arizona->dev,"Failed to do clamp: %d\n" , + ret); + }/* Restore the desired state while not doing the clamp */ if (!clamp) {
@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ; +break ;default :break ; }
Signature · 1 line
1.7.2.5
PATCH 7/8 ASoC: wm8998: Initial WM8998 codec driver
In reply to Richard Fitzgerald--- sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/arizona.c | 7 + sound/soc/codecs/arizona.h | 2 +- sound/soc/codecs/wm8998.c | 1392 ++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8998.h | 23 + 6 files changed, 1431 insertions(+), 1 deletions(-) create mode 100644 sound/soc/codecs/wm8998.c create mode 100644 sound/soc/codecs/wm8998.h
sound/soc/codecs/Kconfig +6 -0
@@ -165,6 +165,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8995 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8996 if I2C select SND_SOC_WM8997 if MFD_WM8997 + select SND_SOC_WM8998 if MFD_WM8998 select SND_SOC_WM9081 if I2C select SND_SOC_WM9090 if I2C select SND_SOC_WM9705 if SND_SOC_AC97_BUS
@@ -189,9 +190,11 @@ config SND_SOC_ARIZONA default y if SND_SOC_WM5102=y default y if SND_SOC_WM5110=y default y if SND_SOC_WM8997=y + default y if SND_SOC_WM8998=y default m if SND_SOC_WM5102=m default m if SND_SOC_WM5110=m default m if SND_SOC_WM8997=m + default m if SND_SOC_WM8998=m config SND_SOC_WM_HUBS tristate
@@ -829,6 +832,9 @@ config SND_SOC_WM8996 config SND_SOC_WM8997 tristate +config SND_SOC_WM8998 + tristate + config SND_SOC_WM9081 tristate
sound/soc/codecs/Makefile +2 -0
@@ -169,6 +169,7 @@ snd-soc-wm8993-objs := wm8993.o snd-soc-wm8994-objs := wm8994.o wm8958-dsp2.o snd-soc-wm8995-objs := wm8995.o snd-soc-wm8997-objs := wm8997.o +snd-soc-wm8998-objs := wm8998.o snd-soc-wm9081-objs := wm9081.o snd-soc-wm9090-objs := wm9090.o snd-soc-wm9705-objs := wm9705.o
@@ -350,6 +351,7 @@ obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o obj-$(CONFIG_SND_SOC_WM8997) += snd-soc-wm8997.o +obj-$(CONFIG_SND_SOC_WM8998) += snd-soc-wm8998.o obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o
sound/soc/codecs/arizona.c +7 -0
@@ -314,6 +314,7 @@ const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {"Tone Generator 2" ,"Haptics" ,"AEC" , +"AEC2" ,"Mic Mute Mixer" ,"Noise Generator" , "IN1L",
@@ -421,6 +422,7 @@ int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS] = {0x05 ,0x06 ,/* Haptics */ 0x08 ,/* AEC */ +0x09 ,/* AEC2 */ 0x0c ,/* Noise mixer */ 0x0d ,/* Comfort noise */ 0x10, /* IN1L */
@@ -1733,6 +1735,11 @@ static int arizona_calc_fratio(struct arizona_fll *fll,if (fll->arizona->rev <3 || sync)return init_ratio;break ; +case WM8998 : +case WM1814 : +if (sync) +return init_ratio; +break ;default :return init_ratio; }
sound/soc/codecs/arizona.h +1 -1
@@ -86,7 +86,7 @@ struct arizona_priv { unsigned int spk_ena_pending:1; }; -#define ARIZONA_NUM_MIXER_INPUTS 103 +#define ARIZONA_NUM_MIXER_INPUTS 104extern const unsigned int arizona_mixer_tlv[];extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS ];
sound/soc/codecs/wm8998.c new file +1392 -0
1,392 lines not on this page · raw message
sound/soc/codecs/wm8998.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* wm8998.h -- ALSA SoC Audio driver for WM8998 codecs +* +* Copyright 2012-2014 Wolfson Microelectronics plc +* +* Author: Richard Fitzgerald <[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. +*/ + +#ifndef _WM8998_H +#define _WM8998_H + +#include "arizona.h" + +#define WM8998_FLL1 1 +#define WM8998_FLL2 2 +#define WM8998_FLL1_REFCLK 3 +#define WM8998_FLL2_REFCLK 4 + +#endif
Signature · 1 line
1.7.2.5
Chanwoo Choi
maintainerRe: [PATCH 6/8] extcon: arizona: Add support for WM8998 and WM1814
In reply to Richard FitzgeraldHi Richard,
Quoted 64 lines · Richard Fitzgerald
Signed-off-by Richard Fitzgerald <[email protected]>--- drivers/extcon/extcon-arizona.c | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)drivers/extcon/extcon-arizona.c +17
-11@@ -1,7 +1,7 @@/* * extcon-arizona.c - Extcon driver Wolfson Arizona devices * -* Copyright (C) 2012 Wolfson Microelectronics plc +* Copyright (C) 2012-2014 Wolfson Microelectronics plc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -140,10 +140,14 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info, bool clamp) {struct arizona *arizona = info->arizona; -unsigned int mask =0 , val =0 ; +unsigned int mask, val =0 ;int ret;switch (arizona->type) { +case WM8998 : +case WM1814 : + mask =0 ; +break ;case WM5110 : mask =ARIZONA_HP1L_SHRTO |ARIZONA_HP1L_FLWR |ARIZONA_HP1L_SHRTI ;@@ -175,17 +179,19 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info, ret); } - ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1L , - mask, val); -if (ret !=0 ) -dev_warn (arizona->dev,"Failed to do clamp: %d\n" , +if (mask) { + ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1L , + mask, val); +if (ret !=0 ) +dev_warn (arizona->dev,"Failed to do clamp: %d\n" , ret); - ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1R , - mask, val); -if (ret !=0 ) -dev_warn (arizona->dev,"Failed to do clamp: %d\n" , - ret); + ret =regmap_update_bits (arizona->regmap,ARIZONA_HP_CTRL_1R , + mask, val); +if (ret !=0 ) +dev_warn (arizona->dev,"Failed to do clamp: %d\n" , + ret); + }/* Restore the desired state while not doing the clamp */ if (!clamp) {
drivers/extcon/extcon-arizona.c static int arizona_extcon_probe(struct platform_device *pdev) · line 1188
Quoted 7 lines
drivers/extcon/extcon-arizona.c +4
-0@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ;
What is meaning of '2'? I prefer to use the definition for '2'.
Except for upper one comment, looks good to me.
Thanks,
Chanwoo Choi
Re: [PATCH 6/8] extcon: arizona: Add support for WM8998 and WM1814
Quoted 13 lines · Chanwoo Choi
Hi Richard,
drivers/extcon/extcon-arizona.c static int arizona_extcon_probe(struct platform_device *pdev) · line 1188
Quoted 8 lines
drivers/extcon/extcon-arizona.c +4
-0@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ;What is meaning of '2'? I prefer to use the definition for '2'.
'2' is the version number of the hpdet ip block in silicon. We're already using it as a raw number '0', '1' or '2' all over extcon-arizona.c so changing it here would mean making other patches to the file that aren't really part of adding WM8998 support, so I'd prefer not to change that as a side-effect of adding WM8998.
Quoted 4 lines
Except for upper one comment, looks good to me.
Thanks,
Chanwoo Choi
Chanwoo Choi
maintainerRe: [PATCH 6/8] extcon: arizona: Add support for WM8998 and WM1814
Quoted 15 lines · Richard Fitzgerald
Quoted 13 lines · Chanwoo Choi
Hi Richard,
drivers/extcon/extcon-arizona.c static int arizona_extcon_probe(struct platform_device *pdev) · line 1188
Quoted 8 lines
drivers/extcon/extcon-arizona.c +4
-0@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ;What is meaning of '2'? I prefer to use the definition for '2'.
Quoted 4 lines
'2' is the version number of the hpdet ip block in silicon. We're already using it as a raw number '0', '1' or '2' all over
extcon-arizona.cso changing it here would mean making other patches to the file that aren't really part of adding WM8998 support, so I'd prefer not to change that as a side-effect of adding WM8998.
I think that just you can define following definitions and use HPDET_IP_VER_V2 instead of '2'.
#define HPDET_IP_VER_V0 0 #define HPDET_IP_VER_V1 1 #define HPDET_IP_VER_V2 2
Mark Brown
maintainerRe: [PATCH 7/8] ASoC: wm8998: Initial WM8998 codec driver
In reply to Richard FitzgeraldQuoted 19 lines · Richard Fitzgerald
sound/soc/codecs/wm8998.c new file +19
-0+static int wm8998_in1mux_ev (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol, +int event) +{ +struct snd_soc_codec *codec =snd_soc_dapm_to_codec (w->dapm); +struct arizona *arizona =dev_get_drvdata (codec->dev->parent); +unsigned int left_mux, right_mux, in1mode, old; + +switch (event) { +case SND_SOC_DAPM_PRE_PMU : +/* Validate the mux configuration */ + left_mux =snd_soc_read (codec,ARIZONA_ADC_DIGITAL_VOLUME_1L ) & +ARIZONA_IN1L_SRC_MASK ; + right_mux =snd_soc_read (codec,ARIZONA_ADC_DIGITAL_VOLUME_1R ) & +ARIZONA_IN1R_SRC_MASK ; + +/* Only IN1A can be digital, IN1B is always analogue */ + in1mode = (arizona->pdata.inmode[0 ] &2 ) + << (ARIZONA_IN1_MODE_SHIFT -1 );
sound/soc/codecs/wm8998.c line 1192
Quoted 10 lines
sound/soc/codecs/wm8998.c new file +10
-0+ +if (in1mode !=0 ) { +/* if IN1A is digital, the only valid mux configs +* are both channels A or both channels B. +*/ +if (left_mux != right_mux) { +dev_err (arizona->dev, +"IN1=DMIC and IN1L Mux != IN1R Mux" ); +return -EINVAL ; + }
This (or at least some of it) seems like something we should be doing by registering different widgets and routing at device probe time.
sound/soc/codecs/wm8998.c line 1206
Quoted 6 lines
sound/soc/codecs/wm8998.c new file +5
-0+ old =snd_soc_read (codec,ARIZONA_IN1L_CONTROL ) & +ARIZONA_IN1_MODE_MASK ; +if (old != in1mode) +snd_soc_update_bits (codec,ARIZONA_IN1L_CONTROL , +ARIZONA_IN1_MODE_MASK , in1mode);
Why bother with the read into old here? Suppressing redundant updates is part of the point of snd_soc_update_bits().
Re: [PATCH 5/8] regulator: arizona: add support for WM8998 and WM1814
In reply to Richard FitzgeraldQuoted 1 line · Richard Fitzgerald
Signed-off-by Richard Fitzgerald <[email protected]>
Re: [PATCH 2/8] ASoC: arizona: add defines for single-input gain control
In reply to Richard FitzgeraldQuoted 3 lines · Richard Fitzgerald
Adds convenience defines for declaring a gain control that has an input mux. These block are functionally equivalent to the existing mixer blocks but only have a single input.
...can only have a single input active at once.
Mark Brown
maintainerRe: [PATCH 3/8] mfd: arizona: Add support for WM8998 and WM1814
In reply to Richard Fitzgeralddrivers/mfd/arizona-core.c static irqreturn_t arizona_underclocked(int irq, void *data) · line 169
Quoted 10 lines · Richard Fitzgerald
drivers/mfd/arizona-core.c +10
-0+switch (arizona->type) { +case WM8998 : +case WM1814 : +/* Some bits are shifted on WM8998, +* rearrange to match the standard bit layout +*/ + val[0 ] = ((val[0 ] &0x60e0 ) >>1 ) | + ((val[0 ] &0x1e00 ) >>2 ) | + (val[0 ] &0x000f ); +break ;
Are you sure this approach is going to scale (and avoid confusion)?
Re: [PATCH 7/8] ASoC: wm8998: Initial WM8998 codec driver
In reply to Richard FitzgeraldA license mismatch is all I spotted.
sound/soc/codecs/wm8998.c line 10
Quoted 6 lines · Richard Fitzgerald
sound/soc/codecs/wm8998.c new file +3
-0+* 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.
This states the license is GPL v2.
Quoted 1 line
+MODULE_LICENSE("GPL");
And, according to include/linux/module.h, this states the license is GPL v2 or later. So I think either the comment at the top of this file or the license ident used in the MODULE_LICENSE() macro needs to change.
Paul Bolle
Re: [alsa-devel] [PATCH 8/8] Documentation: Add WM8998/WM1814 device tree bindings
In reply to Richard FitzgeraldQuoted 14 lines · Richard Fitzgerald
Signed-off-by Richard Fitzgerald <[email protected]>---
Documentation/devicetree/bindings/mfd/arizona.txt| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)Documentation/devicetree/bindings/mfd/arizona.txt +0
-0
Documentation/devicetree/bindings/mfd/arizona.txt Required properties: · line 15
Quoted 6 lines
Documentation/devicetree/bindings/mfd/arizona.txt +3
-0@@ -10,6 +10,9 @@ Required properties: "wlf,wm5110" "wlf,wm8280" "wlf,wm8997" + "wlf,WM8998" + "wlf,wm1814" +
Is there a reason for caps on the 8998?
-Brian
Re: [alsa-devel] [PATCH 6/8] extcon: arizona: Add support for WM8998 and WM1814
In reply to Chanwoo ChoiQuoted 21 lines · Chanwoo Choi
Quoted 15 lines · Richard Fitzgerald
Quoted 13 lines · Chanwoo Choi
Hi Richard,
drivers/extcon/extcon-arizona.c static int arizona_extcon_probe(struct platform_device *pdev) · line 1188
Quoted 8 lines
drivers/extcon/extcon-arizona.c +4
-0@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ;What is meaning of '2'? I prefer to use the definition for '2'.
Quoted 4 lines
'2' is the version number of the hpdet ip block in silicon. We're already using it as a raw number '0', '1' or '2' all over
extcon-arizona.cso changing it here would mean making other patches to the file that aren't really part of adding WM8998 support, so I'd prefer not to change that as a side-effect of adding WM8998.
Quoted 6 lines
I think that just you can define following definitions and use
HPDET_IP_VER_V2instead of '2'.#define HPDET_IP_VER_V0 0 #define HPDET_IP_VER_V1 1 #define HPDET_IP_VER_V2 2
Can we deal with that as a separate patch from this series? Like I said, the code already uses '0' '1' and '2' for the existing codecs so making a change to use #define means patching the code for the other codecs. That is not part of adding WM8998 support and I don't like patches that make unexpected extra side-effect changes that are not relevant to the actual functionality being added by the patch. It's specially annoying when cherry-picking or reverting those patches if they included some extra code change.
If we can get this series submitted I can look at making a later patch to improve readbility, but since this really is just a version number I think it would be enough to rename the variable to hpdet_ip_version rather than effectively doing #define TWO 2
Quoted 4 lines
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [PATCH 7/8] ASoC: wm8998: Initial WM8998 codec driver
In reply to Mark BrownQuoted 26 lines · Mark Brown
Quoted 24 lines · Richard Fitzgerald
sound/soc/codecs/wm8998.c new file +24
-0+static int wm8998_in1mux_ev (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol, +int event) +{ +struct snd_soc_codec *codec =snd_soc_dapm_to_codec (w->dapm); +struct arizona *arizona =dev_get_drvdata (codec->dev->parent); +unsigned int left_mux, right_mux, in1mode, old; + +switch (event) { +case SND_SOC_DAPM_PRE_PMU : +/* Validate the mux configuration */ + left_mux =snd_soc_read (codec,ARIZONA_ADC_DIGITAL_VOLUME_1L ) & +ARIZONA_IN1L_SRC_MASK ; + right_mux =snd_soc_read (codec,ARIZONA_ADC_DIGITAL_VOLUME_1R ) & +ARIZONA_IN1R_SRC_MASK ; + +/* Only IN1A can be digital, IN1B is always analogue */ + in1mode = (arizona->pdata.inmode[0 ] &2 ) + << (ARIZONA_IN1_MODE_SHIFT -1 ); + +if (in1mode !=0 ) { +/* if IN1A is digital, the only valid mux configs +* are both channels A or both channels B. +*/
Quoted 8 lines
sound/soc/codecs/wm8998.c line 1192
Quoted 5 lines
sound/soc/codecs/wm8998.c new file +5
-0+if (left_mux != right_mux) { +dev_err (arizona->dev, +"IN1=DMIC and IN1L Mux != IN1R Mux" ); +return -EINVAL ; + }This (or at least some of it) seems like something we should be doing by registering different widgets and routing at device probe time.
I'm not sure this is really a routing or widget problem. Problem is that if the muxed inputs are analogue we need to provide separate ALSA controls for the left and right mux because it is allowed to use them as two independant mono channels with separate muxing. But if they are configured as digital the mux controls are ganged so must be set the same. I don't feel good about registering a single mux control if its digital and two if its analogue because that means the codec's control list depends on a pdata option. I could implement the control pair so that if the input is digital changing one control always changes the other so they will always be forced to the same setting. Any better options?
Quoted 10 lines
sound/soc/codecs/wm8998.c line 1206
Quoted 7 lines
sound/soc/codecs/wm8998.c new file +5
-0+ old =snd_soc_read (codec,ARIZONA_IN1L_CONTROL ) & +ARIZONA_IN1_MODE_MASK ; +if (old != in1mode) +snd_soc_update_bits (codec,ARIZONA_IN1L_CONTROL , +ARIZONA_IN1_MODE_MASK , in1mode);Why bother with the read into old here? Suppressing redundant updates is part of the point of
snd_soc_update_bits().
Agreed, probably a legacy of an earlier implementation that's now redundant.
--
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 8/8] Documentation: Add WM8998/WM1814 device tree bindings
In reply to Austin, BrianQuoted 22 lines · Brian
Quoted 14 lines · Richard Fitzgerald
Signed-off-by Richard Fitzgerald <[email protected]>---
Documentation/devicetree/bindings/mfd/arizona.txt| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)Documentation/devicetree/bindings/mfd/arizona.txt +0
-0Documentation/devicetree/bindings/mfd/arizona.txt Required properties: · line 15
Quoted 6 lines
Documentation/devicetree/bindings/mfd/arizona.txt +3
-0@@ -10,6 +10,9 @@ Required properties: "wlf,wm5110" "wlf,wm8280" "wlf,wm8997" + "wlf,WM8998" + "wlf,wm1814" +Is there a reason for caps on the 8998?
Quoted 1 line
-Brian
Yes, it's called "lack of attention to detail". Will be fixed in the respin.
Quoted 4 lines
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainerRe: [PATCH 7/8] ASoC: wm8998: Initial WM8998 codec driver
In reply to Richard FitzgeraldQuoted 5 lines · Richard Fitzgerald
I'm not sure this is really a routing or widget problem. Problem is that if the muxed inputs are analogue we need to provide separate ALSA controls for the left and right mux because it is allowed to use them as two independant mono channels with separate muxing. But if they are configured as digital the mux controls are ganged so must be set the
I understand this, it's what prompted my comment.
Quoted 3 lines
same. I don't feel good about registering a single mux control if its digital and two if its analogue because that means the codec's control list depends on a pdata option. I could implement the control pair
I don't see that as a problem, it's not like the disallowed options would ever meaningfully exist for users on an affected system. Why do you see this as a problem?
Re: [alsa-devel] [PATCH 6/8] extcon: arizona: Add support for WM8998 and WM1814
In reply to Richard FitzgeraldQuoted 38 lines · Richard Fitzgerald
Quoted 21 lines · Chanwoo Choi
Quoted 15 lines · Richard Fitzgerald
Quoted 13 lines · Chanwoo Choi
Hi Richard,
drivers/extcon/extcon-arizona.c static int arizona_extcon_probe(struct platform_device *pdev) · line 1188
Quoted 8 lines
drivers/extcon/extcon-arizona.c +4
-0@@ -1176,6 +1182,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)break ; }break ; +case WM8998 : +case WM1814 : + info->micd_clamp = true; + info->hpdet_ip =2 ;What is meaning of '2'? I prefer to use the definition for '2'.
Quoted 4 lines
'2' is the version number of the hpdet ip block in silicon. We're already using it as a raw number '0', '1' or '2' all over
extcon-arizona.cso changing it here would mean making other patches to the file that aren't really part of adding WM8998 support, so I'd prefer not to change that as a side-effect of adding WM8998.Quoted 6 lines
I think that just you can define following definitions and use
HPDET_IP_VER_V2instead of '2'.#define HPDET_IP_VER_V0 0 #define HPDET_IP_VER_V1 1 #define HPDET_IP_VER_V2 2Can we deal with that as a separate patch from this series? Like I said, the code already uses '0' '1' and '2' for the existing codecs so making a change to use #define means patching the code for the other codecs. That is not part of adding WM8998 support and I don't like patches that make unexpected extra side-effect changes that are not relevant to the actual functionality being added by the patch. It's specially annoying when cherry-picking or reverting those patches if they included some extra code change.
Quoted 4 lines
If we can get this series submitted I can look at making a later patch to improve readbility, but since this really is just a version number I think it would be enough to rename the variable to
hpdet_ip_versionrather than effectively doing #define TWO 2
OK. I agree that rename the variable name (hpdet_ip_version) or add the definitions for version on later patch.
Thanks,
Chanwoo Choi
Re: [PATCH 3/8] mfd: arizona: Add support for WM8998 and WM1814
In reply to Mark BrownQuoted 14 lines · Mark Brown
drivers/mfd/arizona-core.c static irqreturn_t arizona_underclocked(int irq, void *data) · line 169
Quoted 10 lines · Richard Fitzgerald
drivers/mfd/arizona-core.c +10
-0+switch (arizona->type) { +case WM8998 : +case WM1814 : +/* Some bits are shifted on WM8998, +* rearrange to match the standard bit layout +*/ + val[0 ] = ((val[0 ] &0x60e0 ) >>1 ) | + ((val[0 ] &0x1e00 ) >>2 ) | + (val[0 ] &0x000f ); +break ;Are you sure this approach is going to scale (and avoid confusion)?
It's a total one-off for the WM8998/WM1814, no other codecs have this shifted-bit-position problem. This shouldn't happen for any future codecs, so I don't feel like it's worth over-complicating it.
Re: [PATCH 4/8] gpio: arizona: add support for WM8998 and WM1814
In reply to Richard FitzgeraldQuoted 1 line · Richard Fitzgerald
Signed-off-by Richard Fitzgerald <[email protected]>
I guess this patch will go through the MFD tree?
Yours,
Linus Walleij
Mark Brown
maintainerApplied "ASoC: arizona: add defines for single-input gain control" to the asoc tree
In reply to Richard FitzgeraldThe patch
ASoC: arizona: add defines for single-input gain control
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
50e6168f27fdc1f915d3341743b46147c626dc6eMon Sep 17 00:00:00 2001
From: Richard Fitzgerald <[email protected]>
Date: Mon, 28 Sep 2015 14:01:08 +0100
Subject: [PATCH] ASoC: arizona: add defines for single-input gain control
Adds convenience defines for declaring a gain control that has an input mux. These blocks are functionally equivalent to the existing mixer blocks but can only have a single input active at once.
--- sound/soc/codecs/arizona.h | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/codecs/arizona.h +5 -0
@@ -99,6 +99,11 @@ extern const unsigned int arizona_mixer_tlv[];extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS ];extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS ]; +#define ARIZONA_GAINMUX_CONTROLS (name, base) \ + SOC_SINGLE_RANGE_TLV(name " Input Volume", base + 1, \ + ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \ + arizona_mixer_tlv) +#define ARIZONA_MIXER_CONTROLS (name, base) \ SOC_SINGLE_RANGE_TLV(name " Input 1 Volume", base + 1, \ ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
Signature · 1 line
2.5.0