Commit d0a51634 authored by Noralf Trønnes's avatar Noralf Trønnes

drm/tinydrm: Remove tinydrm_shutdown()

It's just a wrapper around drm_atomic_helper_shutdown() now.
Also store drm_device in the drvdata field, since that's what's used.
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-7-noralf@tronnes.org
parent 96f2a9ae
...@@ -166,18 +166,4 @@ int devm_tinydrm_register(struct tinydrm_device *tdev) ...@@ -166,18 +166,4 @@ int devm_tinydrm_register(struct tinydrm_device *tdev)
} }
EXPORT_SYMBOL(devm_tinydrm_register); EXPORT_SYMBOL(devm_tinydrm_register);
/**
* tinydrm_shutdown - Shutdown tinydrm
* @tdev: tinydrm device
*
* This function makes sure that the display pipeline is disabled.
* Used by drivers in their shutdown callback to turn off the display
* on machine shutdown and reboot.
*/
void tinydrm_shutdown(struct tinydrm_device *tdev)
{
drm_atomic_helper_shutdown(tdev->drm);
}
EXPORT_SYMBOL(tinydrm_shutdown);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/property.h> #include <linux/property.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
...@@ -243,16 +244,14 @@ static int hx8357d_probe(struct spi_device *spi) ...@@ -243,16 +244,14 @@ static int hx8357d_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void hx8357d_shutdown(struct spi_device *spi) static void hx8357d_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static struct spi_driver hx8357d_spi_driver = { static struct spi_driver hx8357d_spi_driver = {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_damage_helper.h> #include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_cma_helper.h>
...@@ -399,16 +400,14 @@ static int ili9225_probe(struct spi_device *spi) ...@@ -399,16 +400,14 @@ static int ili9225_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void ili9225_shutdown(struct spi_device *spi) static void ili9225_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static struct spi_driver ili9225_spi_driver = { static struct spi_driver ili9225_spi_driver = {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/property.h> #include <linux/property.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
...@@ -205,16 +206,14 @@ static int ili9341_probe(struct spi_device *spi) ...@@ -205,16 +206,14 @@ static int ili9341_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void ili9341_shutdown(struct spi_device *spi) static void ili9341_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static struct spi_driver ili9341_spi_driver = { static struct spi_driver ili9341_spi_driver = {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
...@@ -218,30 +219,24 @@ static int mi0283qt_probe(struct spi_device *spi) ...@@ -218,30 +219,24 @@ static int mi0283qt_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void mi0283qt_shutdown(struct spi_device *spi) static void mi0283qt_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static int __maybe_unused mi0283qt_pm_suspend(struct device *dev) static int __maybe_unused mi0283qt_pm_suspend(struct device *dev)
{ {
struct mipi_dbi *mipi = dev_get_drvdata(dev); return drm_mode_config_helper_suspend(dev_get_drvdata(dev));
return drm_mode_config_helper_suspend(mipi->tinydrm.drm);
} }
static int __maybe_unused mi0283qt_pm_resume(struct device *dev) static int __maybe_unused mi0283qt_pm_resume(struct device *dev)
{ {
struct mipi_dbi *mipi = dev_get_drvdata(dev); drm_mode_config_helper_resume(dev_get_drvdata(dev));
drm_mode_config_helper_resume(mipi->tinydrm.drm);
return 0; return 0;
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/thermal.h> #include <linux/thermal.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_damage_helper.h> #include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_cma_helper.h>
...@@ -1077,7 +1078,8 @@ static int repaper_probe(struct spi_device *spi) ...@@ -1077,7 +1078,8 @@ static int repaper_probe(struct spi_device *spi)
return ret; return ret;
drm_mode_config_reset(tdev->drm); drm_mode_config_reset(tdev->drm);
spi_set_drvdata(spi, tdev);
spi_set_drvdata(spi, tdev->drm);
DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000);
...@@ -1086,9 +1088,7 @@ static int repaper_probe(struct spi_device *spi) ...@@ -1086,9 +1088,7 @@ static int repaper_probe(struct spi_device *spi)
static void repaper_shutdown(struct spi_device *spi) static void repaper_shutdown(struct spi_device *spi)
{ {
struct tinydrm_device *tdev = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(tdev);
} }
static struct spi_driver repaper_spi_driver = { static struct spi_driver repaper_spi_driver = {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_damage_helper.h> #include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_cma_helper.h>
...@@ -389,16 +390,14 @@ static int st7586_probe(struct spi_device *spi) ...@@ -389,16 +390,14 @@ static int st7586_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void st7586_shutdown(struct spi_device *spi) static void st7586_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static struct spi_driver st7586_spi_driver = { static struct spi_driver st7586_spi_driver = {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
...@@ -183,16 +184,14 @@ static int st7735r_probe(struct spi_device *spi) ...@@ -183,16 +184,14 @@ static int st7735r_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
spi_set_drvdata(spi, mipi); spi_set_drvdata(spi, mipi->tinydrm.drm);
return devm_tinydrm_register(&mipi->tinydrm); return devm_tinydrm_register(&mipi->tinydrm);
} }
static void st7735r_shutdown(struct spi_device *spi) static void st7735r_shutdown(struct spi_device *spi)
{ {
struct mipi_dbi *mipi = spi_get_drvdata(spi); drm_atomic_helper_shutdown(spi_get_drvdata(spi));
tinydrm_shutdown(&mipi->tinydrm);
} }
static struct spi_driver st7735r_spi_driver = { static struct spi_driver st7735r_spi_driver = {
......
...@@ -38,6 +38,5 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) ...@@ -38,6 +38,5 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)
int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev, int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
struct drm_driver *driver); struct drm_driver *driver);
int devm_tinydrm_register(struct tinydrm_device *tdev); int devm_tinydrm_register(struct tinydrm_device *tdev);
void tinydrm_shutdown(struct tinydrm_device *tdev);
#endif /* __LINUX_TINYDRM_H */ #endif /* __LINUX_TINYDRM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment