diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2019-02-10 16:10:33 +0300 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2019-02-21 14:21:44 +0300 |
commit | d0a516347688eb031902852aaa7f5e72ee1db3c8 (patch) | |
tree | 9071f2988169bcacc11f30683d8af25fec022bea | |
parent | 96f2a9aef5987340d367ab7497ae972a55e6f71c (diff) | |
download | linux-d0a516347688eb031902852aaa7f5e72ee1db3c8.tar.xz |
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: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-7-noralf@tronnes.org
-rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/hx8357d.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9225.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9341.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/mi0283qt.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/repaper.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7586.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7735r.c | 7 | ||||
-rw-r--r-- | include/drm/tinydrm/tinydrm.h | 1 |
9 files changed, 24 insertions, 49 deletions
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c index 554abd5d3b53..2366a33fd62f 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c @@ -166,18 +166,4 @@ int devm_tinydrm_register(struct tinydrm_device *tdev) } 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"); diff --git a/drivers/gpu/drm/tinydrm/hx8357d.c b/drivers/gpu/drm/tinydrm/hx8357d.c index 5a1ec0451c19..cb0ea98306a0 100644 --- a/drivers/gpu/drm/tinydrm/hx8357d.c +++ b/drivers/gpu/drm/tinydrm/hx8357d.c @@ -16,6 +16,7 @@ #include <linux/property.h> #include <linux/spi/spi.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> @@ -243,16 +244,14 @@ static int hx8357d_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void hx8357d_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver hx8357d_spi_driver = { diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index d40814d370e2..7837b785a993 100644 --- a/drivers/gpu/drm/tinydrm/ili9225.c +++ b/drivers/gpu/drm/tinydrm/ili9225.c @@ -20,6 +20,7 @@ #include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> @@ -399,16 +400,14 @@ static int ili9225_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void ili9225_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver ili9225_spi_driver = { diff --git a/drivers/gpu/drm/tinydrm/ili9341.c b/drivers/gpu/drm/tinydrm/ili9341.c index 063f4f07f811..87400a970c1a 100644 --- a/drivers/gpu/drm/tinydrm/ili9341.c +++ b/drivers/gpu/drm/tinydrm/ili9341.c @@ -15,6 +15,7 @@ #include <linux/property.h> #include <linux/spi/spi.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> @@ -205,16 +206,14 @@ static int ili9341_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void ili9341_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver ili9341_spi_driver = { diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index 3d067c2ba1bc..1fa0cda0ddb5 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c @@ -17,6 +17,7 @@ #include <linux/regulator/consumer.h> #include <linux/spi/spi.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> @@ -218,30 +219,24 @@ static int mi0283qt_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void mi0283qt_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static int __maybe_unused mi0283qt_pm_suspend(struct device *dev) { - struct mipi_dbi *mipi = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(mipi->tinydrm.drm); + return drm_mode_config_helper_suspend(dev_get_drvdata(dev)); } static int __maybe_unused mi0283qt_pm_resume(struct device *dev) { - struct mipi_dbi *mipi = dev_get_drvdata(dev); - - drm_mode_config_helper_resume(mipi->tinydrm.drm); + drm_mode_config_helper_resume(dev_get_drvdata(dev)); return 0; } diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 0f80f4e41215..a32dda09458a 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c @@ -26,6 +26,7 @@ #include <linux/spi/spi.h> #include <linux/thermal.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> @@ -1077,7 +1078,8 @@ static int repaper_probe(struct spi_device *spi) return ret; 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); @@ -1086,9 +1088,7 @@ static int repaper_probe(struct spi_device *spi) static void repaper_shutdown(struct spi_device *spi) { - struct tinydrm_device *tdev = spi_get_drvdata(spi); - - tinydrm_shutdown(tdev); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver repaper_spi_driver = { diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index eb66e36bcd71..20d79a1aa539 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c @@ -17,6 +17,7 @@ #include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> @@ -389,16 +390,14 @@ static int st7586_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void st7586_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver st7586_spi_driver = { diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c index 6c7904c205f0..9b47d8632f1a 100644 --- a/drivers/gpu/drm/tinydrm/st7735r.c +++ b/drivers/gpu/drm/tinydrm/st7735r.c @@ -14,6 +14,7 @@ #include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> @@ -183,16 +184,14 @@ static int st7735r_probe(struct spi_device *spi) if (ret) return ret; - spi_set_drvdata(spi, mipi); + spi_set_drvdata(spi, mipi->tinydrm.drm); return devm_tinydrm_register(&mipi->tinydrm); } static void st7735r_shutdown(struct spi_device *spi) { - struct mipi_dbi *mipi = spi_get_drvdata(spi); - - tinydrm_shutdown(&mipi->tinydrm); + drm_atomic_helper_shutdown(spi_get_drvdata(spi)); } static struct spi_driver st7735r_spi_driver = { diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h index 69c4363fd88e..ee9b17759391 100644 --- a/include/drm/tinydrm/tinydrm.h +++ b/include/drm/tinydrm/tinydrm.h @@ -38,6 +38,5 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev, struct drm_driver *driver); int devm_tinydrm_register(struct tinydrm_device *tdev); -void tinydrm_shutdown(struct tinydrm_device *tdev); #endif /* __LINUX_TINYDRM_H */ |