Skip to content
Snippets Groups Projects
Select Git revision
  • 76dce2a96c0f48295e92acf7a8f3fa46ea0ee524
  • drm-misc-templates default
  • wip/final/kci-gitlab-lava-v1
  • wip/vignesh/kci-lava-gitlab-runner
  • kci-gitlab-igt-v8
  • kci-gitlab-igt-v4
  • drm-misc-fixes-2024-10-02
  • drm-misc-next-2024-09-26
  • drm-misc-fixes-2024-09-26
  • drm-misc-next-2024-09-20
  • drm-misc-fixes-2024-09-12
  • drm-misc-fixes-2024-09-05
  • drm-misc-next-fixes-2024-09-05
  • drm-misc-fixes-2024-08-29
  • drm-misc-next-2024-08-29
  • drm-misc-next-2024-08-22
  • drm-misc-fixes-2024-08-22
  • drm-misc-next-2024-08-16
  • drm-misc-fixes-2024-08-15
  • drm-misc-next-2024-08-09
  • drm-misc-fixes-2024-08-08
  • drm-misc-next-2024-08-01
  • drm-misc-fixes-2024-08-01
  • drm-misc-next-fixes-2024-07-25
  • drm-misc-next-fixes-2024-07-19
  • drm-misc-next-fixes-2024-07-11
26 results

panel-newvision-nv3052c.c

Blame
  • panel-newvision-nv3052c.c 24.80 KiB
    // SPDX-License-Identifier: GPL-2.0
    /*
     * NewVision NV3052C IPS LCD panel driver
     *
     * Copyright (C) 2020, Paul Cercueil <paul@crapouillou.net>
     * Copyright (C) 2022, Christophe Branchereau <cbranchereau@gmail.com>
     */
    
    #include <linux/delay.h>
    #include <linux/device.h>
    #include <linux/gpio/consumer.h>
    #include <linux/media-bus-format.h>
    #include <linux/module.h>
    #include <linux/of.h>
    #include <linux/platform_device.h>
    #include <linux/regulator/consumer.h>
    #include <linux/spi/spi.h>
    #include <video/mipi_display.h>
    #include <drm/drm_mipi_dbi.h>
    #include <drm/drm_modes.h>
    #include <drm/drm_panel.h>
    
    struct nv3052c_reg {
    	u8 cmd;
    	u8 val;
    };
    
    struct nv3052c_panel_info {
    	const struct drm_display_mode *display_modes;
    	unsigned int num_modes;
    	u16 width_mm, height_mm;
    	u32 bus_format, bus_flags;
    	const struct nv3052c_reg *panel_regs;
    	unsigned int panel_regs_len;
    };
    
    struct nv3052c {
    	struct device *dev;
    	struct drm_panel panel;
    	struct mipi_dbi dbi;
    	const struct nv3052c_panel_info *panel_info;
    	struct regulator *supply;
    	struct gpio_desc *reset_gpio;
    };
    
    static const struct nv3052c_reg ltk035c5444t_panel_regs[] = {
    	// EXTC Command set enable, select page 1
    	{ 0xff, 0x30 }, { 0xff, 0x52 }, { 0xff, 0x01 },
    	// Mostly unknown registers
    	{ 0xe3, 0x00 },
    	{ 0x40, 0x00 },
    	{ 0x03, 0x40 },
    	{ 0x04, 0x00 },
    	{ 0x05, 0x03 },
    	{ 0x08, 0x00 },
    	{ 0x09, 0x07 },
    	{ 0x0a, 0x01 },
    	{ 0x0b, 0x32 },
    	{ 0x0c, 0x32 },
    	{ 0x0d, 0x0b },
    	{ 0x0e, 0x00 },
    	{ 0x23, 0xa0 },
    	{ 0x24, 0x0c },
    	{ 0x25, 0x06 },
    	{ 0x26, 0x14 },
    	{ 0x27, 0x14 },
    	{ 0x38, 0xcc }, // VCOM_ADJ1
    	{ 0x39, 0xd7 }, // VCOM_ADJ2
    	{ 0x3a, 0x4a }, // VCOM_ADJ3
    	{ 0x28, 0x40 },