On Tue, Dec 20, 2022 at 08:12:23PM +0100, Emanuele Ghidoli wrote: > On 20/12/2022 11:00, Charles Keepax wrote: > >On Mon, Dec 19, 2022 at 04:20:10PM +0100, Emanuele Ghidoli wrote: > >>On 19/12/2022 10:58, Charles Keepax wrote: > >>>On Sat, Dec 17, 2022 at 12:47:14AM +0100, Emanuele Ghidoli wrote: > >I see that that CP_DYN_PWR bit is disabled when audio is going > >through one of the bypass paths. Would you be able to enable one > >of the bypass paths and see if you can manually adjust the volume > >on the headphone output, with a bypass path active? > With the previous change, I tested all the possible combination with > one channel from the DAC and the other toggling from DAC to Bypass > changing the volume and it's always correct. > > >Would also perhaps be interesting as a test to completely remove > >the write to CP_DYN_PWR from probe and leave things set to manual > >and see how the volume behaves then? > When I tried to remove any write to this register my modification > stopped working. > Apologies just to be totally clear here, you are saying that whilst a bypass path is active (ie. the class G widget has cleared CP_DYN_PWR), you can still control the volume? But if you remove the set of CP_DYN_PWR from probe, the volume doesn't update at all, audio playing or not? > >I guess the interests here are to find out if the SYSCLK is > >involved at all. > I tested keep the clock always enabled, removing > clk_disable_unprepare when going into SND_SOC_BIAS_OFF and it has > zero effects. > Or did you mean something else? > Yeah that is not quite what I was getting at. I am wondering if volume updates work whilst CP_DYN_PWR==0 and CLK_SYS_ENA==1. > Said all of that, I did one last test, forcing a volume update on > the charge pump enable callback, cp_event(), with this and only this > modification in everything is working fine. > > Could it just be as easy as that the volume is applied only when the > charge pump is already active? > > From the datasheet this seems a good explanation: > > The Charge Pump is enabled by setting the CP_ENA bit. When enabled, the > charge pump adjusts the output voltages (CPVOUTP and CPVOUTN). > > What do you think? I think we are getting pretty close, but we need to try and narrow down what the requirement is here, is it the charge pump, or the sysclk? That needs to be on for the volume update to work. Thanks, Charles