drm: Add driver for Solomon SSD130x OLED displays

This adds a DRM driver for SSD1305, SSD1306, SSD1307 and SSD1309 Solomon
OLED display controllers.

It's only the core part of the driver and a bus specific driver is needed
for each transport interface supported by the display controllers.
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220214133710.3278506-4-javierm@redhat.com
parent bcf8b616
......@@ -403,6 +403,8 @@ source "drivers/gpu/drm/xlnx/Kconfig"
source "drivers/gpu/drm/gud/Kconfig"
source "drivers/gpu/drm/solomon/Kconfig"
source "drivers/gpu/drm/sprd/Kconfig"
config DRM_HYPERV
......
......@@ -132,4 +132,5 @@ obj-$(CONFIG_DRM_TIDSS) += tidss/
obj-y += xlnx/
obj-y += gud/
obj-$(CONFIG_DRM_HYPERV) += hyperv/
obj-y += solomon/
obj-$(CONFIG_DRM_SPRD) += sprd/
config DRM_SSD130X
tristate "DRM support for Solomon SSD130x OLED displays"
depends on DRM
select BACKLIGHT_CLASS_DEVICE
select DRM_GEM_SHMEM_HELPER
select DRM_KMS_HELPER
help
DRM driver for the SSD1305, SSD1306, SSD1307 and SSD1309 Solomon
OLED controllers. This is only for the core driver, a driver for
the appropriate bus transport in your chip also must be selected.
If M is selected the module will be called ssd130x.
obj-$(CONFIG_DRM_SSD130X) += ssd130x.o
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Header file for:
* DRM driver for Solomon SSD130x OLED displays
*
* Copyright 2022 Red Hat Inc.
* Author: Javier Martinez Canillas <javierm@redhat.com>
*
* Based on drivers/video/fbdev/ssd1307fb.c
* Copyright 2012 Free Electrons
*/
#ifndef __SSD1307X_H__
#define __SSD1307X_H__
#include <drm/drm_drv.h>
#include <drm/drm_simple_kms_helper.h>
#include <linux/regmap.h>
struct ssd130x_deviceinfo {
u32 default_vcomh;
u32 default_dclk_div;
u32 default_dclk_frq;
int need_pwm;
int need_chargepump;
};
struct ssd130x_device {
struct drm_device drm;
struct device *dev;
struct drm_simple_display_pipe pipe;
struct drm_display_mode mode;
struct drm_connector connector;
struct i2c_client *client;
struct regmap *regmap;
const struct ssd130x_deviceinfo *device_info;
unsigned area_color_enable : 1;
unsigned com_invdir : 1;
unsigned com_lrremap : 1;
unsigned com_seq : 1;
unsigned lookup_table_set : 1;
unsigned low_power : 1;
unsigned seg_remap : 1;
u32 com_offset;
u32 contrast;
u32 dclk_div;
u32 dclk_frq;
u32 height;
u8 lookup_table[4];
u32 page_offset;
u32 col_offset;
u32 prechargep1;
u32 prechargep2;
struct backlight_device *bl_dev;
struct pwm_device *pwm;
struct gpio_desc *reset;
struct regulator *vcc_reg;
u32 vcomh;
u32 width;
/* Cached address ranges */
u8 col_start;
u8 col_end;
u8 page_start;
u8 page_end;
};
struct ssd130x_device *ssd130x_probe(struct device *dev, struct regmap *regmap);
int ssd130x_remove(struct ssd130x_device *ssd130x);
void ssd130x_shutdown(struct ssd130x_device *ssd130x);
#endif /* __SSD1307X_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment