drm/ssd130x: Add a controller family id to the device info data

To allow the driver to have a per Solomon display controller modesetting
pipeline and support aother controller families besides SSD130x.
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-3-javierm@redhat.com
parent ec5dceb8
...@@ -54,6 +54,7 @@ static void ssd130x_i2c_shutdown(struct i2c_client *client) ...@@ -54,6 +54,7 @@ static void ssd130x_i2c_shutdown(struct i2c_client *client)
} }
static const struct of_device_id ssd130x_of_match[] = { static const struct of_device_id ssd130x_of_match[] = {
/* ssd130x family */
{ {
.compatible = "sinowealth,sh1106", .compatible = "sinowealth,sh1106",
.data = &ssd130x_variants[SH1106_ID], .data = &ssd130x_variants[SH1106_ID],
......
...@@ -108,6 +108,7 @@ static void ssd130x_spi_shutdown(struct spi_device *spi) ...@@ -108,6 +108,7 @@ static void ssd130x_spi_shutdown(struct spi_device *spi)
} }
static const struct of_device_id ssd130x_of_match[] = { static const struct of_device_id ssd130x_of_match[] = {
/* ssd130x family */
{ {
.compatible = "sinowealth,sh1106", .compatible = "sinowealth,sh1106",
.data = &ssd130x_variants[SH1106_ID], .data = &ssd130x_variants[SH1106_ID],
...@@ -142,6 +143,7 @@ MODULE_DEVICE_TABLE(of, ssd130x_of_match); ...@@ -142,6 +143,7 @@ MODULE_DEVICE_TABLE(of, ssd130x_of_match);
* not be needed for this driver to match the registered SPI devices. * not be needed for this driver to match the registered SPI devices.
*/ */
static const struct spi_device_id ssd130x_spi_table[] = { static const struct spi_device_id ssd130x_spi_table[] = {
/* ssd130x family */
{ "sh1106", SH1106_ID }, { "sh1106", SH1106_ID },
{ "ssd1305", SSD1305_ID }, { "ssd1305", SSD1305_ID },
{ "ssd1306", SSD1306_ID }, { "ssd1306", SSD1306_ID },
......
...@@ -104,6 +104,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = { ...@@ -104,6 +104,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = {
.default_width = 132, .default_width = 132,
.default_height = 64, .default_height = 64,
.page_mode_only = 1, .page_mode_only = 1,
.family_id = SSD130X_FAMILY,
}, },
[SSD1305_ID] = { [SSD1305_ID] = {
.default_vcomh = 0x34, .default_vcomh = 0x34,
...@@ -111,6 +112,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = { ...@@ -111,6 +112,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = {
.default_dclk_frq = 7, .default_dclk_frq = 7,
.default_width = 132, .default_width = 132,
.default_height = 64, .default_height = 64,
.family_id = SSD130X_FAMILY,
}, },
[SSD1306_ID] = { [SSD1306_ID] = {
.default_vcomh = 0x20, .default_vcomh = 0x20,
...@@ -119,6 +121,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = { ...@@ -119,6 +121,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = {
.need_chargepump = 1, .need_chargepump = 1,
.default_width = 128, .default_width = 128,
.default_height = 64, .default_height = 64,
.family_id = SSD130X_FAMILY,
}, },
[SSD1307_ID] = { [SSD1307_ID] = {
.default_vcomh = 0x20, .default_vcomh = 0x20,
...@@ -127,6 +130,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = { ...@@ -127,6 +130,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = {
.need_pwm = 1, .need_pwm = 1,
.default_width = 128, .default_width = 128,
.default_height = 39, .default_height = 39,
.family_id = SSD130X_FAMILY,
}, },
[SSD1309_ID] = { [SSD1309_ID] = {
.default_vcomh = 0x34, .default_vcomh = 0x34,
...@@ -134,6 +138,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = { ...@@ -134,6 +138,7 @@ const struct ssd130x_deviceinfo ssd130x_variants[] = {
.default_dclk_frq = 10, .default_dclk_frq = 10,
.default_width = 128, .default_width = 128,
.default_height = 64, .default_height = 64,
.family_id = SSD130X_FAMILY,
} }
}; };
EXPORT_SYMBOL_NS_GPL(ssd130x_variants, DRM_SSD130X); EXPORT_SYMBOL_NS_GPL(ssd130x_variants, DRM_SSD130X);
......
...@@ -24,7 +24,12 @@ ...@@ -24,7 +24,12 @@
#define SSD130X_DATA 0x40 #define SSD130X_DATA 0x40
#define SSD130X_COMMAND 0x80 #define SSD130X_COMMAND 0x80
enum ssd130x_family_ids {
SSD130X_FAMILY
};
enum ssd130x_variants { enum ssd130x_variants {
/* ssd130x family */
SH1106_ID, SH1106_ID,
SSD1305_ID, SSD1305_ID,
SSD1306_ID, SSD1306_ID,
...@@ -42,6 +47,8 @@ struct ssd130x_deviceinfo { ...@@ -42,6 +47,8 @@ struct ssd130x_deviceinfo {
bool need_pwm; bool need_pwm;
bool need_chargepump; bool need_chargepump;
bool page_mode_only; bool page_mode_only;
enum ssd130x_family_ids family_id;
}; };
struct ssd130x_device { struct ssd130x_device {
......
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