Skip to contentSkip to conversation

question on dapm_reg_event()

DISCUSSION Haojian Zhuang 3 participants 4 messages Jan 5, 2010 – Jan 6, 2010

lore
Share & tools
lore
#0 lore raw

Hi all,

I just have a question on dapm code. In dapm_reg_event(), -(w->reg +
1) is input parameter of snd_soc_update_bits(). Why we need to use negative value as input parameter at here? Why do we not use w->reg at here?

Thanks
Haojian

#1 lore raw
Quoted 4 lines · Haojian Zhuang

I just have a question on dapm code. In dapm_reg_event(), -(w->reg +
1) is input parameter of snd_soc_update_bits(). Why we need to use negative value as input parameter at here? Why do we not use w->reg at here?

Hrm, no, that's not at all clear to me either. CCing Jarkko who contributed the register write control originally.

#2 lore raw
Quoted 9 lines · On Wed, 6 Jan 2010 14:53:22 +0000 Mark Brown…
Quoted 4 lines · Haojian Zhuang

I just have a question on dapm code. In dapm_reg_event(), -(w->reg +
1) is input parameter of snd_soc_update_bits(). Why we need to use negative value as input parameter at here? Why do we not use w->reg at here?

Hrm, no, that's not at all clear to me either. CCing Jarkko who contributed the register write control originally.

IIRC, there were some reason to avoid register update by the dapm_update_bits and negative register value was used to prevent it.

Reg+1 makes sure that the value is negative also for register 0.

Signature · 1 line
Jarkko
#3 lore raw
Quoted 9 lines · Jarkko Nikula
Quoted 2 lines · Mark Brown

Hrm, no, that's not at all clear to me either. CCing Jarkko who contributed the register write control originally.

IIRC, there were some reason to avoid register update by the dapm_update_bits and negative register value was used to prevent it.

Reg+1 makes sure that the value is negative also for register 0.

Ah, you're using some of the shared fields that the generic widget handling code then tries to interpret itself. It'd probably be less surprising to special case this widget in the generic code (as we do in a few other cases, like the PGA ramping).