2022-03-31 02:29:03

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 4/4] drm: ssd130x: Add support for SINO WEALTH SH1106

From: Chen-Yu Tsai <[email protected]>

The SINO WEALTH SH1106 is an OLED display driver that is somewhat
compatible with the SSD1306. It supports a slightly wider display,
at 132 instead of 128 pixels. The basic commands are the same, but
the SH1106 doesn't support the horizontal or vertical address modes.

Add support for this display driver. The default values for some of
the hardware settings are taken from the datasheet.

Signed-off-by: Chen-Yu Tsai <[email protected]>
---
drivers/gpu/drm/solomon/ssd130x-i2c.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/solomon/ssd130x-i2c.c b/drivers/gpu/drm/solomon/ssd130x-i2c.c
index 3126aeda4ced..d099b241dd3f 100644
--- a/drivers/gpu/drm/solomon/ssd130x-i2c.c
+++ b/drivers/gpu/drm/solomon/ssd130x-i2c.c
@@ -53,6 +53,13 @@ static void ssd130x_i2c_shutdown(struct i2c_client *client)
ssd130x_shutdown(ssd130x);
}

+static struct ssd130x_deviceinfo ssd130x_sh1106_deviceinfo = {
+ .default_vcomh = 0x40,
+ .default_dclk_div = 1,
+ .default_dclk_frq = 5,
+ .page_mode_only = 1,
+};
+
static struct ssd130x_deviceinfo ssd130x_ssd1305_deviceinfo = {
.default_vcomh = 0x34,
.default_dclk_div = 1,
@@ -80,6 +87,10 @@ static struct ssd130x_deviceinfo ssd130x_ssd1309_deviceinfo = {
};

static const struct of_device_id ssd130x_of_match[] = {
+ {
+ .compatible = "sinowealth,sh1106-i2c",
+ .data = &ssd130x_sh1106_deviceinfo,
+ },
{
.compatible = "solomon,ssd1305fb-i2c",
.data = &ssd130x_ssd1305_deviceinfo,
--
2.34.1


2022-04-02 16:02:22

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 4/4] drm: ssd130x: Add support for SINO WEALTH SH1106

On Wed, Mar 30, 2022 at 9:09 PM Chen-Yu Tsai <[email protected]> wrote:
>
> From: Chen-Yu Tsai <[email protected]>
>
> The SINO WEALTH SH1106 is an OLED display driver that is somewhat
> compatible with the SSD1306. It supports a slightly wider display,
> at 132 instead of 128 pixels. The basic commands are the same, but
> the SH1106 doesn't support the horizontal or vertical address modes.
>
> Add support for this display driver. The default values for some of
> the hardware settings are taken from the datasheet.
>
> Signed-off-by: Chen-Yu Tsai <[email protected]>
> ---
> drivers/gpu/drm/solomon/ssd130x-i2c.c | 11 +++++++++++

Thanks a lot for this patch. It's very nice to see that another
variant of the OLED controller is being supported!

I wonder if we should also list SH1106 in the
drivers/gpu/drm/solomon/Kconfig file so people can find it ?

ah, one comment I forgot in 3/4 but that also applies to this patch, I
believe the convention in DRM is for the subject line to be
"drm/ssd130x:" instead of "drm: ssd130x:"

Reviewed-by: Javier Martinez Canillas <[email protected]>

Best regards,
Javier

2022-04-04 23:52:47

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 4/4] drm: ssd130x: Add support for SINO WEALTH SH1106

On 4/4/22 18:35, Chen-Yu Tsai wrote:
> On Fri, Apr 1, 2022 at 6:10 PM Javier Martinez Canillas
> <[email protected]> wrote:

[snip]

>>
>> I wonder if we should also list SH1106 in the
>> drivers/gpu/drm/solomon/Kconfig file so people can find it ?
>
> I can add it to the help text if that helps?
>

No strong opinion really, it was an honest question.

> Recently someone mentioned that users are more likely to find drivers
> via compatible strings though. And I believe there's also a tool in-tree
> that finds all drivers given a device tree.
>

Yeah I guess so. Looking at existing DTS and drivers' device tables is
certainly what I personally do when searching it a device is supported.

--
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat

2022-04-05 02:40:52

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH 4/4] drm: ssd130x: Add support for SINO WEALTH SH1106

On Fri, Apr 1, 2022 at 6:10 PM Javier Martinez Canillas
<[email protected]> wrote:
>
> On Wed, Mar 30, 2022 at 9:09 PM Chen-Yu Tsai <[email protected]> wrote:
> >
> > From: Chen-Yu Tsai <[email protected]>
> >
> > The SINO WEALTH SH1106 is an OLED display driver that is somewhat
> > compatible with the SSD1306. It supports a slightly wider display,
> > at 132 instead of 128 pixels. The basic commands are the same, but
> > the SH1106 doesn't support the horizontal or vertical address modes.
> >
> > Add support for this display driver. The default values for some of
> > the hardware settings are taken from the datasheet.
> >
> > Signed-off-by: Chen-Yu Tsai <[email protected]>
> > ---
> > drivers/gpu/drm/solomon/ssd130x-i2c.c | 11 +++++++++++
>
> Thanks a lot for this patch. It's very nice to see that another
> variant of the OLED controller is being supported!
>
> I wonder if we should also list SH1106 in the
> drivers/gpu/drm/solomon/Kconfig file so people can find it ?

I can add it to the help text if that helps?

Recently someone mentioned that users are more likely to find drivers
via compatible strings though. And I believe there's also a tool in-tree
that finds all drivers given a device tree.

> ah, one comment I forgot in 3/4 but that also applies to this patch, I
> believe the convention in DRM is for the subject line to be
> "drm/ssd130x:" instead of "drm: ssd130x:"

Ack.

> Reviewed-by: Javier Martinez Canillas <[email protected]>


Thanks
ChenYu