diff options
Diffstat (limited to 'drivers/soundwire/bus_type.c')
-rw-r--r-- | drivers/soundwire/bus_type.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index 8d8dcc6..d5f3a70 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -77,6 +77,8 @@ static int sdw_drv_probe(struct device *dev) if (!id) return -ENODEV; + slave->ops = drv->ops; + /* * attach to power domain but don't turn on (last arg) */ @@ -89,7 +91,26 @@ static int sdw_drv_probe(struct device *dev) } } - return ret; + if (ret) + return ret; + + /* device is probed so let's read the properties now */ + if (slave->ops && slave->ops->read_prop) + slave->ops->read_prop(slave); + + /* + * Check for valid clk_stop_timeout, use DisCo worst case value of + * 300ms + * + * TODO: check the timeouts and driver removal case + */ + if (slave->prop.clk_stop_timeout == 0) + slave->prop.clk_stop_timeout = 300; + + slave->bus->clk_stop_timeout = max_t(u32, slave->bus->clk_stop_timeout, + slave->prop.clk_stop_timeout); + + return 0; } static int sdw_drv_remove(struct device *dev) |