17467389bSPaul Cercueil // SPDX-License-Identifier: GPL-2.0
27467389bSPaul Cercueil /*
37467389bSPaul Cercueil * Asia Better Technology Ltd. Y030XX067A IPS LCD panel driver
47467389bSPaul Cercueil *
57467389bSPaul Cercueil * Copyright (C) 2020, Paul Cercueil <paul@crapouillou.net>
67467389bSPaul Cercueil * Copyright (C) 2020, Christophe Branchereau <cbranchereau@gmail.com>
77467389bSPaul Cercueil */
87467389bSPaul Cercueil
97467389bSPaul Cercueil #include <linux/delay.h>
107467389bSPaul Cercueil #include <linux/device.h>
117467389bSPaul Cercueil #include <linux/gpio/consumer.h>
127467389bSPaul Cercueil #include <linux/media-bus-format.h>
137467389bSPaul Cercueil #include <linux/module.h>
14*722d4f06SRob Herring #include <linux/of.h>
15*722d4f06SRob Herring #include <linux/platform_device.h>
167467389bSPaul Cercueil #include <linux/regmap.h>
177467389bSPaul Cercueil #include <linux/regulator/consumer.h>
187467389bSPaul Cercueil #include <linux/spi/spi.h>
197467389bSPaul Cercueil
207467389bSPaul Cercueil #include <drm/drm_modes.h>
217467389bSPaul Cercueil #include <drm/drm_panel.h>
227467389bSPaul Cercueil
237467389bSPaul Cercueil #define REG00_VBRT_CTRL(val) (val)
247467389bSPaul Cercueil
257467389bSPaul Cercueil #define REG01_COM_DC(val) (val)
267467389bSPaul Cercueil
277467389bSPaul Cercueil #define REG02_DA_CONTRAST(val) (val)
287467389bSPaul Cercueil #define REG02_VESA_SEL(val) ((val) << 5)
297467389bSPaul Cercueil #define REG02_COMDC_SW BIT(7)
307467389bSPaul Cercueil
317467389bSPaul Cercueil #define REG03_VPOSITION(val) (val)
327467389bSPaul Cercueil #define REG03_BSMOUNT BIT(5)
337467389bSPaul Cercueil #define REG03_COMTST BIT(6)
347467389bSPaul Cercueil #define REG03_HPOSITION1 BIT(7)
357467389bSPaul Cercueil
367467389bSPaul Cercueil #define REG04_HPOSITION1(val) (val)
377467389bSPaul Cercueil
387467389bSPaul Cercueil #define REG05_CLIP BIT(0)
397467389bSPaul Cercueil #define REG05_NVM_VREFRESH BIT(1)
407467389bSPaul Cercueil #define REG05_SLFR BIT(2)
417467389bSPaul Cercueil #define REG05_SLBRCHARGE(val) ((val) << 3)
427467389bSPaul Cercueil #define REG05_PRECHARGE_LEVEL(val) ((val) << 6)
437467389bSPaul Cercueil
447467389bSPaul Cercueil #define REG06_TEST5 BIT(0)
457467389bSPaul Cercueil #define REG06_SLDWN BIT(1)
467467389bSPaul Cercueil #define REG06_SLRGT BIT(2)
477467389bSPaul Cercueil #define REG06_TEST2 BIT(3)
487467389bSPaul Cercueil #define REG06_XPSAVE BIT(4)
497467389bSPaul Cercueil #define REG06_GAMMA_SEL(val) ((val) << 5)
507467389bSPaul Cercueil #define REG06_NT BIT(7)
517467389bSPaul Cercueil
527467389bSPaul Cercueil #define REG07_TEST1 BIT(0)
537467389bSPaul Cercueil #define REG07_HDVD_POL BIT(1)
547467389bSPaul Cercueil #define REG07_CK_POL BIT(2)
557467389bSPaul Cercueil #define REG07_TEST3 BIT(3)
567467389bSPaul Cercueil #define REG07_TEST4 BIT(4)
577467389bSPaul Cercueil #define REG07_480_LINEMASK BIT(5)
587467389bSPaul Cercueil #define REG07_AMPTST(val) ((val) << 6)
597467389bSPaul Cercueil
607467389bSPaul Cercueil #define REG08_SLHRC(val) (val)
617467389bSPaul Cercueil #define REG08_CLOCK_DIV(val) ((val) << 2)
627467389bSPaul Cercueil #define REG08_PANEL(val) ((val) << 5)
637467389bSPaul Cercueil
647467389bSPaul Cercueil #define REG09_SUB_BRIGHT_R(val) (val)
657467389bSPaul Cercueil #define REG09_NW_NB BIT(6)
667467389bSPaul Cercueil #define REG09_IPCON BIT(7)
677467389bSPaul Cercueil
687467389bSPaul Cercueil #define REG0A_SUB_BRIGHT_B(val) (val)
697467389bSPaul Cercueil #define REG0A_PAIR BIT(6)
707467389bSPaul Cercueil #define REG0A_DE_SEL BIT(7)
717467389bSPaul Cercueil
727467389bSPaul Cercueil #define REG0B_MBK_POSITION(val) (val)
737467389bSPaul Cercueil #define REG0B_HD_FREERUN BIT(4)
747467389bSPaul Cercueil #define REG0B_VD_FREERUN BIT(5)
757467389bSPaul Cercueil #define REG0B_YUV2BIN(val) ((val) << 6)
767467389bSPaul Cercueil
777467389bSPaul Cercueil #define REG0C_CONTRAST_R(val) (val)
787467389bSPaul Cercueil #define REG0C_DOUBLEREAD BIT(7)
797467389bSPaul Cercueil
807467389bSPaul Cercueil #define REG0D_CONTRAST_G(val) (val)
817467389bSPaul Cercueil #define REG0D_RGB_YUV BIT(7)
827467389bSPaul Cercueil
837467389bSPaul Cercueil #define REG0E_CONTRAST_B(val) (val)
847467389bSPaul Cercueil #define REG0E_PIXELCOLORDRIVE BIT(7)
857467389bSPaul Cercueil
867467389bSPaul Cercueil #define REG0F_ASPECT BIT(0)
877467389bSPaul Cercueil #define REG0F_OVERSCAN(val) ((val) << 1)
887467389bSPaul Cercueil #define REG0F_FRAMEWIDTH(val) ((val) << 3)
897467389bSPaul Cercueil
907467389bSPaul Cercueil #define REG10_BRIGHT(val) (val)
917467389bSPaul Cercueil
927467389bSPaul Cercueil #define REG11_SIG_GAIN(val) (val)
937467389bSPaul Cercueil #define REG11_SIGC_CNTL BIT(6)
947467389bSPaul Cercueil #define REG11_SIGC_POL BIT(7)
957467389bSPaul Cercueil
967467389bSPaul Cercueil #define REG12_COLOR(val) (val)
977467389bSPaul Cercueil #define REG12_PWCKSEL(val) ((val) << 6)
987467389bSPaul Cercueil
997467389bSPaul Cercueil #define REG13_4096LEVEL_CNTL(val) (val)
1007467389bSPaul Cercueil #define REG13_SL4096(val) ((val) << 4)
1017467389bSPaul Cercueil #define REG13_LIMITER_CONTROL BIT(7)
1027467389bSPaul Cercueil
1037467389bSPaul Cercueil #define REG14_PANEL_TEST(val) (val)
1047467389bSPaul Cercueil
1057467389bSPaul Cercueil #define REG15_NVM_LINK0 BIT(0)
1067467389bSPaul Cercueil #define REG15_NVM_LINK1 BIT(1)
1077467389bSPaul Cercueil #define REG15_NVM_LINK2 BIT(2)
1087467389bSPaul Cercueil #define REG15_NVM_LINK3 BIT(3)
1097467389bSPaul Cercueil #define REG15_NVM_LINK4 BIT(4)
1107467389bSPaul Cercueil #define REG15_NVM_LINK5 BIT(5)
1117467389bSPaul Cercueil #define REG15_NVM_LINK6 BIT(6)
1127467389bSPaul Cercueil #define REG15_NVM_LINK7 BIT(7)
1137467389bSPaul Cercueil
1147467389bSPaul Cercueil struct y030xx067a_info {
1157467389bSPaul Cercueil const struct drm_display_mode *display_modes;
1167467389bSPaul Cercueil unsigned int num_modes;
1177467389bSPaul Cercueil u16 width_mm, height_mm;
1187467389bSPaul Cercueil u32 bus_format, bus_flags;
1197467389bSPaul Cercueil };
1207467389bSPaul Cercueil
1217467389bSPaul Cercueil struct y030xx067a {
1227467389bSPaul Cercueil struct drm_panel panel;
1237467389bSPaul Cercueil struct spi_device *spi;
1247467389bSPaul Cercueil struct regmap *map;
1257467389bSPaul Cercueil
1267467389bSPaul Cercueil const struct y030xx067a_info *panel_info;
1277467389bSPaul Cercueil
1287467389bSPaul Cercueil struct regulator *supply;
1297467389bSPaul Cercueil struct gpio_desc *reset_gpio;
1307467389bSPaul Cercueil };
1317467389bSPaul Cercueil
to_y030xx067a(struct drm_panel * panel)1327467389bSPaul Cercueil static inline struct y030xx067a *to_y030xx067a(struct drm_panel *panel)
1337467389bSPaul Cercueil {
1347467389bSPaul Cercueil return container_of(panel, struct y030xx067a, panel);
1357467389bSPaul Cercueil }
1367467389bSPaul Cercueil
1377467389bSPaul Cercueil static const struct reg_sequence y030xx067a_init_sequence[] = {
1387467389bSPaul Cercueil { 0x00, REG00_VBRT_CTRL(0x7f) },
1397467389bSPaul Cercueil { 0x01, REG01_COM_DC(0x3c) },
1407467389bSPaul Cercueil { 0x02, REG02_VESA_SEL(0x3) | REG02_DA_CONTRAST(0x1f) },
1417467389bSPaul Cercueil { 0x03, REG03_VPOSITION(0x0a) },
1427467389bSPaul Cercueil { 0x04, REG04_HPOSITION1(0xd2) },
1437467389bSPaul Cercueil { 0x05, REG05_CLIP | REG05_NVM_VREFRESH | REG05_SLBRCHARGE(0x2) },
144a271bf32SChristophe Branchereau { 0x06, REG06_NT },
1457467389bSPaul Cercueil { 0x07, 0 },
1467467389bSPaul Cercueil { 0x08, REG08_PANEL(0x1) | REG08_CLOCK_DIV(0x2) },
1477467389bSPaul Cercueil { 0x09, REG09_SUB_BRIGHT_R(0x20) },
1487467389bSPaul Cercueil { 0x0a, REG0A_SUB_BRIGHT_B(0x20) },
1497467389bSPaul Cercueil { 0x0b, REG0B_HD_FREERUN | REG0B_VD_FREERUN },
150413e8d06SChristophe Branchereau { 0x0c, REG0C_CONTRAST_R(0x00) },
151413e8d06SChristophe Branchereau { 0x0d, REG0D_CONTRAST_G(0x00) },
1527467389bSPaul Cercueil { 0x0e, REG0E_CONTRAST_B(0x10) },
1537467389bSPaul Cercueil { 0x0f, 0 },
1547467389bSPaul Cercueil { 0x10, REG10_BRIGHT(0x7f) },
1557467389bSPaul Cercueil { 0x11, REG11_SIGC_CNTL | REG11_SIG_GAIN(0x3f) },
1567467389bSPaul Cercueil { 0x12, REG12_COLOR(0x20) | REG12_PWCKSEL(0x1) },
1577467389bSPaul Cercueil { 0x13, REG13_4096LEVEL_CNTL(0x8) },
1587467389bSPaul Cercueil { 0x14, 0 },
1597467389bSPaul Cercueil { 0x15, 0 },
1607467389bSPaul Cercueil };
1617467389bSPaul Cercueil
y030xx067a_prepare(struct drm_panel * panel)1627467389bSPaul Cercueil static int y030xx067a_prepare(struct drm_panel *panel)
1637467389bSPaul Cercueil {
1647467389bSPaul Cercueil struct y030xx067a *priv = to_y030xx067a(panel);
1657467389bSPaul Cercueil struct device *dev = &priv->spi->dev;
1667467389bSPaul Cercueil int err;
1677467389bSPaul Cercueil
1687467389bSPaul Cercueil err = regulator_enable(priv->supply);
1697467389bSPaul Cercueil if (err) {
1707467389bSPaul Cercueil dev_err(dev, "Failed to enable power supply: %d\n", err);
1717467389bSPaul Cercueil return err;
1727467389bSPaul Cercueil }
1737467389bSPaul Cercueil
1747467389bSPaul Cercueil /* Reset the chip */
1757467389bSPaul Cercueil gpiod_set_value_cansleep(priv->reset_gpio, 1);
1767467389bSPaul Cercueil usleep_range(1000, 20000);
1777467389bSPaul Cercueil gpiod_set_value_cansleep(priv->reset_gpio, 0);
1787467389bSPaul Cercueil usleep_range(1000, 20000);
1797467389bSPaul Cercueil
1807467389bSPaul Cercueil err = regmap_multi_reg_write(priv->map, y030xx067a_init_sequence,
1817467389bSPaul Cercueil ARRAY_SIZE(y030xx067a_init_sequence));
1827467389bSPaul Cercueil if (err) {
1837467389bSPaul Cercueil dev_err(dev, "Failed to init registers: %d\n", err);
1847467389bSPaul Cercueil goto err_disable_regulator;
1857467389bSPaul Cercueil }
1867467389bSPaul Cercueil
1877467389bSPaul Cercueil return 0;
1887467389bSPaul Cercueil
1897467389bSPaul Cercueil err_disable_regulator:
1907467389bSPaul Cercueil regulator_disable(priv->supply);
1917467389bSPaul Cercueil return err;
1927467389bSPaul Cercueil }
1937467389bSPaul Cercueil
y030xx067a_unprepare(struct drm_panel * panel)1947467389bSPaul Cercueil static int y030xx067a_unprepare(struct drm_panel *panel)
1957467389bSPaul Cercueil {
1967467389bSPaul Cercueil struct y030xx067a *priv = to_y030xx067a(panel);
1977467389bSPaul Cercueil
1987467389bSPaul Cercueil gpiod_set_value_cansleep(priv->reset_gpio, 1);
1997467389bSPaul Cercueil regulator_disable(priv->supply);
2007467389bSPaul Cercueil
2017467389bSPaul Cercueil return 0;
2027467389bSPaul Cercueil }
2037467389bSPaul Cercueil
y030xx067a_enable(struct drm_panel * panel)204a271bf32SChristophe Branchereau static int y030xx067a_enable(struct drm_panel *panel)
205a271bf32SChristophe Branchereau {
206a271bf32SChristophe Branchereau struct y030xx067a *priv = to_y030xx067a(panel);
207a271bf32SChristophe Branchereau
208a271bf32SChristophe Branchereau regmap_set_bits(priv->map, 0x06, REG06_XPSAVE);
209a271bf32SChristophe Branchereau
210a271bf32SChristophe Branchereau if (panel->backlight) {
211a271bf32SChristophe Branchereau /* Wait for the picture to be ready before enabling backlight */
212a271bf32SChristophe Branchereau msleep(120);
213a271bf32SChristophe Branchereau }
214a271bf32SChristophe Branchereau
215a271bf32SChristophe Branchereau return 0;
216a271bf32SChristophe Branchereau }
217a271bf32SChristophe Branchereau
y030xx067a_disable(struct drm_panel * panel)218a271bf32SChristophe Branchereau static int y030xx067a_disable(struct drm_panel *panel)
219a271bf32SChristophe Branchereau {
220a271bf32SChristophe Branchereau struct y030xx067a *priv = to_y030xx067a(panel);
221a271bf32SChristophe Branchereau
222a271bf32SChristophe Branchereau regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE);
223a271bf32SChristophe Branchereau
224a271bf32SChristophe Branchereau return 0;
225a271bf32SChristophe Branchereau }
226a271bf32SChristophe Branchereau
y030xx067a_get_modes(struct drm_panel * panel,struct drm_connector * connector)2277467389bSPaul Cercueil static int y030xx067a_get_modes(struct drm_panel *panel,
2287467389bSPaul Cercueil struct drm_connector *connector)
2297467389bSPaul Cercueil {
2307467389bSPaul Cercueil struct y030xx067a *priv = to_y030xx067a(panel);
2317467389bSPaul Cercueil const struct y030xx067a_info *panel_info = priv->panel_info;
2327467389bSPaul Cercueil struct drm_display_mode *mode;
2337467389bSPaul Cercueil unsigned int i;
2347467389bSPaul Cercueil
2357467389bSPaul Cercueil for (i = 0; i < panel_info->num_modes; i++) {
2367467389bSPaul Cercueil mode = drm_mode_duplicate(connector->dev,
2377467389bSPaul Cercueil &panel_info->display_modes[i]);
2387467389bSPaul Cercueil if (!mode)
2397467389bSPaul Cercueil return -ENOMEM;
2407467389bSPaul Cercueil
2417467389bSPaul Cercueil drm_mode_set_name(mode);
2427467389bSPaul Cercueil
2437467389bSPaul Cercueil mode->type = DRM_MODE_TYPE_DRIVER;
2447467389bSPaul Cercueil if (panel_info->num_modes == 1)
2457467389bSPaul Cercueil mode->type |= DRM_MODE_TYPE_PREFERRED;
2467467389bSPaul Cercueil
2477467389bSPaul Cercueil drm_mode_probed_add(connector, mode);
2487467389bSPaul Cercueil }
2497467389bSPaul Cercueil
2507467389bSPaul Cercueil connector->display_info.bpc = 8;
2517467389bSPaul Cercueil connector->display_info.width_mm = panel_info->width_mm;
2527467389bSPaul Cercueil connector->display_info.height_mm = panel_info->height_mm;
2537467389bSPaul Cercueil
2547467389bSPaul Cercueil drm_display_info_set_bus_formats(&connector->display_info,
2557467389bSPaul Cercueil &panel_info->bus_format, 1);
2567467389bSPaul Cercueil connector->display_info.bus_flags = panel_info->bus_flags;
2577467389bSPaul Cercueil
2587467389bSPaul Cercueil return panel_info->num_modes;
2597467389bSPaul Cercueil }
2607467389bSPaul Cercueil
2617467389bSPaul Cercueil static const struct drm_panel_funcs y030xx067a_funcs = {
2627467389bSPaul Cercueil .prepare = y030xx067a_prepare,
2637467389bSPaul Cercueil .unprepare = y030xx067a_unprepare,
264a271bf32SChristophe Branchereau .enable = y030xx067a_enable,
265a271bf32SChristophe Branchereau .disable = y030xx067a_disable,
2667467389bSPaul Cercueil .get_modes = y030xx067a_get_modes,
2677467389bSPaul Cercueil };
2687467389bSPaul Cercueil
2697467389bSPaul Cercueil static const struct regmap_config y030xx067a_regmap_config = {
2707467389bSPaul Cercueil .reg_bits = 8,
2717467389bSPaul Cercueil .val_bits = 8,
2727467389bSPaul Cercueil .max_register = 0x15,
273a271bf32SChristophe Branchereau .cache_type = REGCACHE_FLAT,
2747467389bSPaul Cercueil };
2757467389bSPaul Cercueil
y030xx067a_probe(struct spi_device * spi)2767467389bSPaul Cercueil static int y030xx067a_probe(struct spi_device *spi)
2777467389bSPaul Cercueil {
2787467389bSPaul Cercueil struct device *dev = &spi->dev;
2797467389bSPaul Cercueil struct y030xx067a *priv;
2807467389bSPaul Cercueil int err;
2817467389bSPaul Cercueil
2827467389bSPaul Cercueil priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
2837467389bSPaul Cercueil if (!priv)
2847467389bSPaul Cercueil return -ENOMEM;
2857467389bSPaul Cercueil
2867467389bSPaul Cercueil priv->spi = spi;
2877467389bSPaul Cercueil spi_set_drvdata(spi, priv);
2887467389bSPaul Cercueil
2897467389bSPaul Cercueil priv->map = devm_regmap_init_spi(spi, &y030xx067a_regmap_config);
2907467389bSPaul Cercueil if (IS_ERR(priv->map)) {
2917467389bSPaul Cercueil dev_err(dev, "Unable to init regmap\n");
2927467389bSPaul Cercueil return PTR_ERR(priv->map);
2937467389bSPaul Cercueil }
2947467389bSPaul Cercueil
2957467389bSPaul Cercueil priv->panel_info = of_device_get_match_data(dev);
2967467389bSPaul Cercueil if (!priv->panel_info)
2977467389bSPaul Cercueil return -EINVAL;
2987467389bSPaul Cercueil
2997467389bSPaul Cercueil priv->supply = devm_regulator_get(dev, "power");
300566b651cSCai Huoqing if (IS_ERR(priv->supply))
301566b651cSCai Huoqing return dev_err_probe(dev, PTR_ERR(priv->supply),
302566b651cSCai Huoqing "Failed to get power supply\n");
3037467389bSPaul Cercueil
3047467389bSPaul Cercueil priv->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
305566b651cSCai Huoqing if (IS_ERR(priv->reset_gpio))
306566b651cSCai Huoqing return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
307566b651cSCai Huoqing "Failed to get reset GPIO\n");
3087467389bSPaul Cercueil
3097467389bSPaul Cercueil drm_panel_init(&priv->panel, dev, &y030xx067a_funcs,
3107467389bSPaul Cercueil DRM_MODE_CONNECTOR_DPI);
3117467389bSPaul Cercueil
3127467389bSPaul Cercueil err = drm_panel_of_backlight(&priv->panel);
3137467389bSPaul Cercueil if (err)
3147467389bSPaul Cercueil return err;
3157467389bSPaul Cercueil
3167467389bSPaul Cercueil drm_panel_add(&priv->panel);
3177467389bSPaul Cercueil
3187467389bSPaul Cercueil return 0;
3197467389bSPaul Cercueil }
3207467389bSPaul Cercueil
y030xx067a_remove(struct spi_device * spi)321a0386bbaSUwe Kleine-König static void y030xx067a_remove(struct spi_device *spi)
3227467389bSPaul Cercueil {
3237467389bSPaul Cercueil struct y030xx067a *priv = spi_get_drvdata(spi);
3247467389bSPaul Cercueil
3257467389bSPaul Cercueil drm_panel_remove(&priv->panel);
3267467389bSPaul Cercueil drm_panel_disable(&priv->panel);
3277467389bSPaul Cercueil drm_panel_unprepare(&priv->panel);
3287467389bSPaul Cercueil }
3297467389bSPaul Cercueil
3307467389bSPaul Cercueil static const struct drm_display_mode y030xx067a_modes[] = {
3317467389bSPaul Cercueil { /* 60 Hz */
3327467389bSPaul Cercueil .clock = 14400,
3337467389bSPaul Cercueil .hdisplay = 320,
3347467389bSPaul Cercueil .hsync_start = 320 + 10,
3357467389bSPaul Cercueil .hsync_end = 320 + 10 + 37,
3367467389bSPaul Cercueil .htotal = 320 + 10 + 37 + 33,
3377467389bSPaul Cercueil .vdisplay = 480,
3387467389bSPaul Cercueil .vsync_start = 480 + 84,
3397467389bSPaul Cercueil .vsync_end = 480 + 84 + 20,
3407467389bSPaul Cercueil .vtotal = 480 + 84 + 20 + 16,
3417467389bSPaul Cercueil .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3427467389bSPaul Cercueil },
3437467389bSPaul Cercueil { /* 50 Hz */
3447467389bSPaul Cercueil .clock = 12000,
3457467389bSPaul Cercueil .hdisplay = 320,
3467467389bSPaul Cercueil .hsync_start = 320 + 10,
3477467389bSPaul Cercueil .hsync_end = 320 + 10 + 37,
3487467389bSPaul Cercueil .htotal = 320 + 10 + 37 + 33,
3497467389bSPaul Cercueil .vdisplay = 480,
3507467389bSPaul Cercueil .vsync_start = 480 + 84,
3517467389bSPaul Cercueil .vsync_end = 480 + 84 + 20,
3527467389bSPaul Cercueil .vtotal = 480 + 84 + 20 + 16,
3537467389bSPaul Cercueil .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3547467389bSPaul Cercueil },
3557467389bSPaul Cercueil };
3567467389bSPaul Cercueil
3577467389bSPaul Cercueil static const struct y030xx067a_info y030xx067a_info = {
3587467389bSPaul Cercueil .display_modes = y030xx067a_modes,
3597467389bSPaul Cercueil .num_modes = ARRAY_SIZE(y030xx067a_modes),
3607467389bSPaul Cercueil .width_mm = 69,
3617467389bSPaul Cercueil .height_mm = 51,
3627467389bSPaul Cercueil .bus_format = MEDIA_BUS_FMT_RGB888_3X8_DELTA,
3637467389bSPaul Cercueil .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE | DRM_BUS_FLAG_DE_LOW,
3647467389bSPaul Cercueil };
3657467389bSPaul Cercueil
3667467389bSPaul Cercueil static const struct of_device_id y030xx067a_of_match[] = {
3677467389bSPaul Cercueil { .compatible = "abt,y030xx067a", .data = &y030xx067a_info },
3687467389bSPaul Cercueil { /* sentinel */ }
3697467389bSPaul Cercueil };
3707467389bSPaul Cercueil MODULE_DEVICE_TABLE(of, y030xx067a_of_match);
3717467389bSPaul Cercueil
3727467389bSPaul Cercueil static struct spi_driver y030xx067a_driver = {
3737467389bSPaul Cercueil .driver = {
3747467389bSPaul Cercueil .name = "abt-y030xx067a",
3757467389bSPaul Cercueil .of_match_table = y030xx067a_of_match,
3767467389bSPaul Cercueil },
3777467389bSPaul Cercueil .probe = y030xx067a_probe,
3787467389bSPaul Cercueil .remove = y030xx067a_remove,
3797467389bSPaul Cercueil };
3807467389bSPaul Cercueil module_spi_driver(y030xx067a_driver);
3817467389bSPaul Cercueil
3827467389bSPaul Cercueil MODULE_AUTHOR("Paul Cercueil <paul@crapouillou.net>");
3837467389bSPaul Cercueil MODULE_AUTHOR("Christophe Branchereau <cbranchereau@gmail.com>");
3847467389bSPaul Cercueil MODULE_LICENSE("GPL v2");
385