Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) 2018-2019, Bridge Systems BV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (C) 2018-2019, Bootlin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2017, Free Electrons
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * This file based on panel-ilitek-ili9881c.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/err.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/media-bus-format.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/gpio/consumer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/regulator/consumer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <drm/drm_connector.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <drm/drm_mipi_dsi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <drm/drm_modes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <drm/drm_panel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) struct rb070d30_panel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	struct drm_panel panel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	struct mipi_dsi_device *dsi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	struct regulator *supply;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 		struct gpio_desc *power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 		struct gpio_desc *reset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		struct gpio_desc *updn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 		struct gpio_desc *shlr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	} gpios;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static inline struct rb070d30_panel *panel_to_rb070d30_panel(struct drm_panel *panel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	return container_of(panel, struct rb070d30_panel, panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) static int rb070d30_panel_prepare(struct drm_panel *panel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	ret = regulator_enable(ctx->supply);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		dev_err(&ctx->dsi->dev, "Failed to enable supply: %d\n", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	msleep(20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	gpiod_set_value(ctx->gpios.power, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	msleep(20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	gpiod_set_value(ctx->gpios.reset, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	msleep(20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) static int rb070d30_panel_unprepare(struct drm_panel *panel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	gpiod_set_value(ctx->gpios.reset, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	gpiod_set_value(ctx->gpios.power, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	regulator_disable(ctx->supply);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static int rb070d30_panel_enable(struct drm_panel *panel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) static int rb070d30_panel_disable(struct drm_panel *panel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	return mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) /* Default timings */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) static const struct drm_display_mode default_mode = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	.clock		= 51206,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	.hdisplay	= 1024,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	.hsync_start	= 1024 + 160,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	.hsync_end	= 1024 + 160 + 80,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	.htotal		= 1024 + 160 + 80 + 80,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	.vdisplay	= 600,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	.vsync_start	= 600 + 12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	.vsync_end	= 600 + 12 + 10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	.vtotal		= 600 + 12 + 10 + 13,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	.width_mm	= 154,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	.height_mm	= 85,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) static int rb070d30_panel_get_modes(struct drm_panel *panel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 				    struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	struct drm_display_mode *mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	mode = drm_mode_duplicate(connector->dev, &default_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	if (!mode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		dev_err(&ctx->dsi->dev, "Failed to add mode " DRM_MODE_FMT "\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			DRM_MODE_ARG(&default_mode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	drm_mode_set_name(mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	drm_mode_probed_add(connector, mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	connector->display_info.bpc = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	connector->display_info.width_mm = mode->width_mm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	connector->display_info.height_mm = mode->height_mm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	drm_display_info_set_bus_formats(&connector->display_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 					 &bus_format, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) static const struct drm_panel_funcs rb070d30_panel_funcs = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	.get_modes	= rb070d30_panel_get_modes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	.prepare	= rb070d30_panel_prepare,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	.enable		= rb070d30_panel_enable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	.disable	= rb070d30_panel_disable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	.unprepare	= rb070d30_panel_unprepare,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	struct rb070d30_panel *ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	if (!ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	ctx->supply = devm_regulator_get(&dsi->dev, "vcc-lcd");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	if (IS_ERR(ctx->supply))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		return PTR_ERR(ctx->supply);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	mipi_dsi_set_drvdata(dsi, ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	ctx->dsi = dsi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	drm_panel_init(&ctx->panel, &dsi->dev, &rb070d30_panel_funcs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		       DRM_MODE_CONNECTOR_DSI);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	if (IS_ERR(ctx->gpios.reset)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		dev_err(&dsi->dev, "Couldn't get our reset GPIO\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		return PTR_ERR(ctx->gpios.reset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	ctx->gpios.power = devm_gpiod_get(&dsi->dev, "power", GPIOD_OUT_LOW);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	if (IS_ERR(ctx->gpios.power)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		dev_err(&dsi->dev, "Couldn't get our power GPIO\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		return PTR_ERR(ctx->gpios.power);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	 * We don't change the state of that GPIO later on but we need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	 * to force it into a low state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	ctx->gpios.updn = devm_gpiod_get(&dsi->dev, "updn", GPIOD_OUT_LOW);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	if (IS_ERR(ctx->gpios.updn)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		dev_err(&dsi->dev, "Couldn't get our updn GPIO\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		return PTR_ERR(ctx->gpios.updn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	 * We don't change the state of that GPIO later on but we need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	 * to force it into a low state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	ctx->gpios.shlr = devm_gpiod_get(&dsi->dev, "shlr", GPIOD_OUT_LOW);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	if (IS_ERR(ctx->gpios.shlr)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		dev_err(&dsi->dev, "Couldn't get our shlr GPIO\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		return PTR_ERR(ctx->gpios.shlr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	ret = drm_panel_of_backlight(&ctx->panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	drm_panel_add(&ctx->panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	dsi->format = MIPI_DSI_FMT_RGB888;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	dsi->lanes = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	return mipi_dsi_attach(dsi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static int rb070d30_panel_dsi_remove(struct mipi_dsi_device *dsi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	struct rb070d30_panel *ctx = mipi_dsi_get_drvdata(dsi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	mipi_dsi_detach(dsi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	drm_panel_remove(&ctx->panel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) static const struct of_device_id rb070d30_panel_of_match[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	{ .compatible = "ronbo,rb070d30" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	{ /* sentinel */ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) MODULE_DEVICE_TABLE(of, rb070d30_panel_of_match);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) static struct mipi_dsi_driver rb070d30_panel_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	.probe = rb070d30_panel_dsi_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	.remove = rb070d30_panel_dsi_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		.name = "panel-ronbo-rb070d30",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		.of_match_table	= rb070d30_panel_of_match,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) module_mipi_dsi_driver(rb070d30_panel_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) MODULE_AUTHOR("Boris Brezillon <boris.brezillon@bootlin.com>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) MODULE_AUTHOR("Konstantin Sudakov <k.sudakov@integrasources.com>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) MODULE_DESCRIPTION("Ronbo RB070D30 Panel Driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) MODULE_LICENSE("GPL");