Make genaral and simple for new sof machine driver
cover Make genaral and simple for new sof machine driver
The series of features will make general and simple for new sof machine driver.
David Lin (3):
ASoC: nau8825: add set_jack coponment support
ASoC: nau8825: add disable jack detection support
ASoC: nau8825: add clock management for power saving
sound/soc/codecs/nau8825.c | 49 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-)
PATCH 1/3 ASoC: nau8825: add set_jack coponment support
Use set_jack ops to set jack for new machine drivers. Meanwhile, the old machine drivers can still call previous export function "nau8825_enable_jack_detect".
--- sound/soc/codecs/nau8825.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/codecs/nau8825.c +7 -0
@@ -2416,6 +2416,12 @@ static int __maybe_unused nau8825_resume(struct snd_soc_component *component)return 0 ; } +static int nau8825_set_jack (struct snd_soc_component *component, +struct snd_soc_jack *jack,void *data) +{ +return nau8825_enable_jack_detect (component, jack); +} +static const struct snd_soc_component_driver nau8825_component_driver = { .probe = nau8825_component_probe, .remove = nau8825_component_remove,
@@ -2430,6 +2436,7 @@ static const struct snd_soc_component_driver nau8825_component_driver = { .num_dapm_widgets = ARRAY_SIZE(nau8825_dapm_widgets), .dapm_routes = nau8825_dapm_routes, .num_dapm_routes = ARRAY_SIZE(nau8825_dapm_routes), + .set_jack = nau8825_set_jack, .suspend_bias_off = 1, .idle_bias_on = 1, .use_pmdown_time = 1,
Signature · 1 line
2.25.1
Re: [PATCH 1/3] ASoC: nau8825: add set_jack coponment support
Quoted 5 lines · David Lin
Use
set_jackops to set jack for new machine drivers. Meanwhile, the old machine drivers can still call previous export function "nau8825_enable_jack_detect".Co-Developed-by Mac Chiang <[email protected]>
if you use the Co-developed-by: tag (no capital letter after 'C'), you still need to provide your Signed-off-by: tag
same comment for the 2 other patches in this series.
Quoted 31 lines
Signed-off-by David Lin <[email protected]>--- sound/soc/codecs/nau8825.c | 7 +++++++ 1 file changed, 7 insertions(+)sound/soc/codecs/nau8825.c +7
-0@@ -2416,6 +2416,12 @@ static int __maybe_unused nau8825_resume(struct snd_soc_component *component)return 0 ; } +static int nau8825_set_jack (struct snd_soc_component *component, +struct snd_soc_jack *jack,void *data) +{ +return nau8825_enable_jack_detect (component, jack); +} +static const struct snd_soc_component_driver nau8825_component_driver = { .probe = nau8825_component_probe, .remove = nau8825_component_remove,@@ -2430,6 +2436,7 @@ static const struct snd_soc_component_driver nau8825_component_driver = { .num_dapm_widgets = ARRAY_SIZE(nau8825_dapm_widgets), .dapm_routes = nau8825_dapm_routes, .num_dapm_routes = ARRAY_SIZE(nau8825_dapm_routes), + .set_jack = nau8825_set_jack, .suspend_bias_off = 1, .idle_bias_on = 1, .use_pmdown_time = 1,
Mark Brown
maintainerRe: [PATCH 1/3] ASoC: nau8825: add set_jack coponment support
Quoted 7 lines · Pierre-Louis Bossart
Quoted 4 lines · David Lin
Use
set_jackops to set jack for new machine drivers. Meanwhile, the old machine drivers can still call previous export function "nau8825_enable_jack_detect".
Quoted 10 lines
Quoted 1 line
Co-Developed-by Mac Chiang <[email protected]>if you use the Co-developed-by: tag (no capital letter after 'C'), you still need to provide your Signed-off-by: tag
same comment for the 2 other patches in this series.
Quoted 1 line
Signed-off-by David Lin <[email protected]>
The signoff is there AFAICT?
Re: [PATCH 1/3] ASoC: nau8825: add set_jack coponment support
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Co-Developed-by Mac Chiang <[email protected]>if you use the Co-developed-by: tag (no capital letter after 'C'), you still need to provide your Signed-off-by: tag
Quoted 7 lines
Quoted 5 lines
same comment for the 2 other patches in this series.
Quoted 1 line
Signed-off-by David Lin <[email protected]>The signoff is there AFAICT?
I meant the Signed-off-by: tag of the first co-developer. The rule is:
"
Since Co-developed-by: denotes authorship, every Co-developed-by: must be immediately followed by a Signed-off-by: of the associated co-author. "
so each patch should be tagged as follows:
Mark Brown
maintainerRe: [PATCH 1/3] ASoC: nau8825: add set_jack coponment support
Quoted 11 lines · Pierre-Louis Bossart
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Signed-off-by David Lin <[email protected]>The signoff is there AFAICT?
I meant the Signed-off-by: tag of the first co-developer. The rule is:
"
Since Co-developed-by: denotes authorship, every Co-developed-by: must be immediately followed by a Signed-off-by: of the associated co-author. "
Quoted 5 lines
so each patch should be tagged as follows:
Co-developed-by Mac Chiang <[email protected]>Signed-off-by Mac Chiang <[email protected]>Signed-off-by David Lin <[email protected]>
Oh, that makes the whole thing seem substantially less purposeful than I'd though. David, please update to reflect this.
Re: [PATCH 1/3] ASoC: nau8825: add set_jack coponment support
Quoted 14 lines · Mark Brown
Quoted 4 lines · Pierre-Louis Bossart
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Signed-off-by David Lin <[email protected]>The signoff is there AFAICT?
I meant the Signed-off-by: tag of the first co-developer. The rule is:
Quoted 8 lines
"
Since Co-developed-by: denotes authorship, every Co-developed-by: must be immediately followed by a Signed-off-by: of the associated co-author. "
so each patch should be tagged as follows:Co-developed-by Mac Chiang <[email protected]>Signed-off-by Mac Chiang <[email protected]>Signed-off-by David Lin <[email protected]>
Quoted 2 lines
Oh, that makes the whole thing seem substantially less purposeful than I'd though. David, please update to reflect this.
I appreciate your guide very much. I'll send patch again.
________________________________
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
PATCH 2/3 ASoC: nau8825: add disable jack detection support
In reply to David LinA feature for disabling jack detection support.
--- sound/soc/codecs/nau8825.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/codecs/nau8825.c +7 -0
@@ -1434,6 +1434,13 @@ int nau8825_enable_jack_detect(struct snd_soc_component *component, nau8825->jack = jack; +if (!nau8825->jack) { +regmap_update_bits (regmap,NAU8825_REG_HSD_CTRL , +NAU8825_HSD_AUTO_MODE |NAU8825_SPKR_DWN1R | +NAU8825_SPKR_DWN1L ,0 ); +return 0 ; + } +/* Ground HP Outputs[1:0], needed for headset auto detection * Enable Automatic Mic/Gnd switching reading on insert interrupt[6] */
Signature · 1 line
2.25.1
PATCH 3/3 ASoC: nau8825: add clock management for power saving
In reply to David LinAdjust dapm widget to manage clock from power event for power saving.
--- sound/soc/codecs/nau8825.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
sound/soc/codecs/nau8825.c +33 -2
@@ -47,6 +47,7 @@static int nau8825_configure_sysclk (struct nau8825 *nau8825,int clk_id,unsigned int freq); +static bool nau8825_is_jack_inserted (struct regmap *regmap);struct nau8825_fll {int mclk_src;
@@ -981,6 +982,31 @@ static int nau8825_output_dac_event(struct snd_soc_dapm_widget *w,return 0 ; } +static int system_clock_control (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *k,int event) +{ +struct snd_soc_component *component =snd_soc_dapm_to_component (w->dapm); +struct nau8825 *nau8825 =snd_soc_component_get_drvdata (component); +struct regmap *regmap = nau8825->regmap; + +if (SND_SOC_DAPM_EVENT_OFF (event)) { +dev_dbg (nau8825->dev,"system clock control : POWER OFF\n" ); +/* Set clock source to disable or internal clock before the +* playback or capture end. Codec needs clock for Jack +* detection and button press if jack inserted; otherwise, +* the clock should be closed. +*/ +if (nau8825_is_jack_inserted (regmap)) { +nau8825_configure_sysclk (nau8825, +NAU8825_CLK_INTERNAL ,0 ); + }else { +nau8825_configure_sysclk (nau8825,NAU8825_CLK_DIS ,0 ); + } + } + +return 0 ; +} +static int nau8825_biq_coeff_get (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol) {
@@ -1094,6 +1120,9 @@ static const struct snd_kcontrol_new nau8825_dacr_mux =static const struct snd_soc_dapm_widget nau8825_dapm_widgets[] = {SND_SOC_DAPM_AIF_OUT ("AIFTX" ,"Capture" ,0 ,NAU8825_REG_I2S_PCM_CTRL2 ,15 ,1 ), +SND_SOC_DAPM_AIF_IN ("AIFRX" ,"Playback" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_SUPPLY ("System Clock" ,SND_SOC_NOPM ,0 ,0 , + system_clock_control,SND_SOC_DAPM_POST_PMD ),SND_SOC_DAPM_INPUT ("MIC" ),SND_SOC_DAPM_MICBIAS ("MICBIAS" ,NAU8825_REG_MIC_BIAS ,8 ,0 ),
@@ -1182,9 +1211,11 @@ static const struct snd_soc_dapm_route nau8825_dapm_routes[] = { {"ADC", NULL, "ADC Clock"}, {"ADC", NULL, "ADC Power"}, {"AIFTX", NULL, "ADC"}, + {"AIFTX", NULL, "System Clock"}, - {"DDACL", NULL, "Playback"}, - {"DDACR", NULL, "Playback"}, + {"AIFRX", NULL, "System Clock"}, + {"DDACL", NULL, "AIFRX"}, + {"DDACR", NULL, "AIFRX"}, {"DDACL", NULL, "DDAC Clock"}, {"DDACR", NULL, "DDAC Clock"}, {"DACL Mux", "DACL", "DDACL"},
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 8 lines · David Lin
The series of features will make general and simple for new sof machine driver.
David Lin (3):
ASoC: nau8825: addset_jackcoponment support
ASoC: nau8825: add disable jack detection support
ASoC: nau8825: add clock management for power saving[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: nau8825: add set_jack coponment support
commit: c6167e10e76fb97d37613004046e66027b3a569b
[2/3] ASoC: nau8825: add disable jack detection support
(no commit info)
[3/3] ASoC: nau8825: add clock management for power saving
commit: 6133148ca08a097ed8c57d7f5a7826723273049bAll 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