Re: [PATCH 1/2] soundwire: bus: add CLOCK_STOP_MODE1 support back
Richard Fitzgerald <[email protected]>
| Newsgroups | org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 29/06/2026 3:44 pm, Bard Liao wrote: > CLOCK_STOP_MODE1 is used when the Peripheral might have entered a deeper > power-saving mode that does not retain state while the Clock is stopped. > It is useful when the device is more power consumption sensitive. Add it > back to allow the Peripheral use CLOCK_STOP_MODE1. > > Signed-off-by: Bard Liao <[email protected]> > Reviewed-by: Péter Ujfalusi <[email protected]> <SNIP> > +static enum sdw_clk_stop_mode sdw_get_clk_stop_mode(struct sdw_slave *slave) > +{ > + struct device *dev = &slave->dev; > + struct sdw_driver *drv = drv_to_sdw_driver(dev->driver); dev->driver will be NULL if a driver hasn't probed for this peripheral. It should check slave->probed, like in sdw_slave_clk_stop_callback(). > + > + /* > + * Query for clock stop mode if Slave implements > + * ops->get_clk_stop_mode, else read from property. > + */ > + if (drv->ops && drv->ops->get_clk_stop_mode) > + return drv->ops->get_clk_stop_mode(slave); It should be holding sdw_dev_lock when checking ops and calling the callback .