提交 d1621803 编写于 作者: T Thierry Reding

drm/dsi: Support device shutdown

Hook up the MIPI DSI bus's .shutdown() function to allow drivers to
implement code that should be run when a device is shut down.
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 c9eaa447
...@@ -282,6 +282,14 @@ static int mipi_dsi_drv_remove(struct device *dev) ...@@ -282,6 +282,14 @@ static int mipi_dsi_drv_remove(struct device *dev)
return drv->remove(dsi); return drv->remove(dsi);
} }
static void mipi_dsi_drv_shutdown(struct device *dev)
{
struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
drv->shutdown(dsi);
}
/** /**
* mipi_dsi_driver_register - register a driver for DSI devices * mipi_dsi_driver_register - register a driver for DSI devices
* @drv: DSI driver structure * @drv: DSI driver structure
...@@ -293,6 +301,8 @@ int mipi_dsi_driver_register(struct mipi_dsi_driver *drv) ...@@ -293,6 +301,8 @@ int mipi_dsi_driver_register(struct mipi_dsi_driver *drv)
drv->driver.probe = mipi_dsi_drv_probe; drv->driver.probe = mipi_dsi_drv_probe;
if (drv->remove) if (drv->remove)
drv->driver.remove = mipi_dsi_drv_remove; drv->driver.remove = mipi_dsi_drv_remove;
if (drv->shutdown)
drv->driver.shutdown = mipi_dsi_drv_shutdown;
return driver_register(&drv->driver); return driver_register(&drv->driver);
} }
......
...@@ -135,11 +135,13 @@ ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel, ...@@ -135,11 +135,13 @@ ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel,
* @driver: device driver model driver * @driver: device driver model driver
* @probe: callback for device binding * @probe: callback for device binding
* @remove: callback for device unbinding * @remove: callback for device unbinding
* @shutdown: called at shutdown time to quiesce the device
*/ */
struct mipi_dsi_driver { struct mipi_dsi_driver {
struct device_driver driver; struct device_driver driver;
int(*probe)(struct mipi_dsi_device *dsi); int(*probe)(struct mipi_dsi_device *dsi);
int(*remove)(struct mipi_dsi_device *dsi); int(*remove)(struct mipi_dsi_device *dsi);
void (*shutdown)(struct mipi_dsi_device *dsi);
}; };
#define to_mipi_dsi_driver(d) container_of(d, struct mipi_dsi_driver, driver) #define to_mipi_dsi_driver(d) container_of(d, struct mipi_dsi_driver, driver)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册