@@ -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");
@@ -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>
@@ -242,16 +243,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 = {
@@ -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>
@@ -396,16 +397,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 = {
@@ -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>
@@ -204,16 +205,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 = {
@@ -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>
@@ -217,30 +218,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;
}
@@ -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>
@@ -1085,7 +1086,8 @@ static int repaper_probe(struct spi_device *spi)
drm_simple_connector_set_mode_config(connector);
drm_mode_config_reset(tdev->drm);
- spi_set_drvdata(spi, tdev);
+
+ spi_set_drvdata(spi, drm);
DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000);
@@ -1094,9 +1096,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 = {
@@ -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>
@@ -393,16 +394,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 = {
@@ -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>
@@ -182,16 +183,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 = {
@@ -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 */
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> --- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 14 -------------- drivers/gpu/drm/tinydrm/hx8357d.c | 7 +++---- drivers/gpu/drm/tinydrm/ili9225.c | 7 +++---- drivers/gpu/drm/tinydrm/ili9341.c | 7 +++---- drivers/gpu/drm/tinydrm/mi0283qt.c | 15 +++++---------- drivers/gpu/drm/tinydrm/repaper.c | 8 ++++---- drivers/gpu/drm/tinydrm/st7586.c | 7 +++---- drivers/gpu/drm/tinydrm/st7735r.c | 7 +++---- include/drm/tinydrm/tinydrm.h | 1 - 9 files changed, 24 insertions(+), 49 deletions(-)