Skip to contentSkip to conversation

Add support for the OLED in the CFA10036

PATCH Superseded Maxime Ripard 2 participants 6 messages Oct 31, 2012 – Nov 22, 2012

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add support for the OLED in the CFA10036

Hi everyone,

This patchset adds support for the solomon SSD1307 OLED controller present in the CFA-10036 board.

It first adds the framebuffer driver for this controller, and then the needed bits to enable it in the cfa10036 dts.

Considering that the driver has been around since almost three months now, and I have not received any comments on the framebuffer part, I'd very much like it to be included in 3.8 if possible.

Thanks,
Maxime

Changes from v5:
* Fixed bogus reset code

Maxime Ripard (2):
video: Add support for the Solomon SSD1307 OLED Controller
ARM: dts: mxs: add oled support for the cfa-10036

 .../devicetree/bindings/video/ssd1307fb.txt        |   24 ++
 arch/arm/boot/dts/imx28-cfa10036.dts               |   19 +
 drivers/video/Kconfig                              |   13 +
 drivers/video/Makefile                             |    1 +
 drivers/video/ssd1307fb.c                          |  407 ++++++++++++++++++++
 5 files changed, 464 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/ssd1307fb.txt
 create mode 100644 drivers/video/ssd1307fb.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v6 1/2 video: Add support for the Solomon SSD1307 OLED Controller

This patch adds support for the Solomon SSD1307 OLED controller found on the Crystalfontz CFA10036 board.

This controller can drive a display with a resolution up to 128x39 and can operate over I2C or SPI.

The current driver has only been tested on the CFA-10036, that is using this controller over I2C to driver a 96x16 OLED screen.

---
 .../devicetree/bindings/video/ssd1307fb.txt        |   24 ++
 drivers/video/Kconfig                              |   13 +
 drivers/video/Makefile                             |    1 +
 drivers/video/ssd1307fb.c                          |  407 ++++++++++++++++++++
 4 files changed, 445 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/ssd1307fb.txt
 create mode 100644 drivers/video/ssd1307fb.c
Documentation/devicetree/bindings/video/ssd1307fb.txt new file +24 -0
new file mode 100644
index 0000000..3d0060c
@@ -0,0 +1,24 @@
+* Solomon SSD1307 Framebuffer Driver
+
+Required properties:
+  - compatible: Should be "solomon,ssd1307fb-<bus>". The only supported bus for
+    now is i2c.
+  - reg: Should contain address of the controller on the I2C bus. Most likely
+         0x3c or 0x3d
+  - pwm: Should contain the pwm to use according to the OF device tree PWM
+         specification [0]
+  - reset-gpios: Should contain the GPIO used to reset the OLED display
+
+Optional properties:
+  - reset-active-low: Is the reset gpio is active on physical low?
+
+[0]: Documentation/devicetree/bindings/pwm/pwm.txt
+
+Examples:
+ssd1307: oled at 3c {
+        compatible = "solomon,ssd1307fb-i2c";
+        reg = <0x3c>;
+        pwms = <&pwm 4 3000>;
+        reset-gpios = <&gpio2 7>;
+        reset-active-low;
+};
drivers/video/Kconfig +13 -0
index d08d799..294de9c 100644
@@ -2442,4 +2442,17 @@ config FB_SH_MOBILE_MERAM
 	  Up to 4 memory channels can be configured, allowing 4 RGB or
 	  2 YCbCr framebuffers to be configured.
 
+config FB_SSD1307
+	tristate "Solomon SSD1307 framebuffer support"
+	depends on FB && I2C
+	select FB_SYS_FOPS
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select FB_DEFERRED_IO
+	select PWM
+	help
+	  This driver implements support for the Solomon SSD1307
+	  OLED controller over I2C.
+
 endmenu
drivers/video/Makefile +1 -0
index 23e948e..768a137 100644
@@ -161,6 +161,7 @@ obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
 obj-$(CONFIG_FB_MXS)		  += mxsfb.o
+obj-$(CONFIG_FB_SSD1307)	  += ssd1307fb.o
 
 # the test framebuffer is last
 obj-$(CONFIG_FB_VIRTUAL)          += vfb.o
drivers/video/ssd1307fb.c new file +407 -0

407 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v6 2/2 ARM: dts: mxs: add oled support for the cfa-10036

In reply to Maxime Ripard
---
 arch/arm/boot/dts/imx28-cfa10036.dts |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/imx28-cfa10036.dts +19 -0
index c03a577..816cae9 100644
@@ -33,11 +33,30 @@
 		};
 
 		apbx at 80040000 {
+			pwm: pwm at 80064000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pwm4_pins_a>;
+				status = "okay";
+			};
+
 			duart: serial at 80074000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&duart_pins_b>;
 				status = "okay";
 			};
+
+			i2c0: i2c at 80058000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&i2c0_pins_b>;
+				status = "okay";
+
+				ssd1307: oled at 3c {
+					compatible = "solomon,ssd1307fb-i2c";
+					reg = <0x3c>;
+					pwms = <&pwm 4 3000>;
+					reset-gpios = <&gpio2 7 0>;
+				};
+			};
 		};
 	};
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v6 2/2 ARM: dts: mxs: add oled support for the cfa-10036

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Shawn,

Le 31/10/2012 10:12, Maxime Ripard a ?crit :

Quoted 10 lines

Brian Lilly <[email protected]> ---
arch/arm/boot/dts/imx28-cfa10036.dts | 19 +++++++++++++++++++ 1
file changed, 19 insertions(+)

(quoted diff) +0 -0

b/arch/arm/boot/dts/imx28-cfa10036.dts index c03a577..816cae9 100644 --- a/arch/arm/boot/dts/imx28-cfa10036.dts +++ b/arch/arm/boot/dts/imx28-cfa10036.dts @@ -33,11 +33,30 @@ };

Quoted 8 lines

apbx at 80040000 { + pwm: pwm at 80064000 { + pinctrl-names =
"default"; + pinctrl-0 = <&pwm4_pins_a>; + status = "okay"; +
}; + duart: serial at 80074000 { pinctrl-names = "default"; pinctrl-0
= <&duart_pins_b>; status = "okay"; }; + + i2c0: i2c at 80058000 { +
pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_b>; +
status = "okay"; + + ssd1307: oled at 3c { + compatible =
"solomon,ssd1307fb-i2c"; + reg = <0x3c>; + pwms = <&pwm 4
3000>; + reset-gpios = <&gpio2 7 0>; + }; + }; }; };

Would you consider merging this patch? Andrew Morton merged the driver into its tree
(http://marc.info/?l=linux-fbdev&m=135336761530731&w=2)

Thanks,
Maxime

- --
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux development, consulting, training and support.
http://free-electrons.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCsl7MACgkQGxsu9jQV9nZtJwCfR9c2SnwK1hzAU2F+xptFqg9x 2+0An3YrhNMXSZaPwPcJwc3Bnwy+FSqe
=mjpV
-----END PGP SIGNATURE-----

#5 lore raw

v6 cover Add support for the OLED in the CFA10036

In reply to Maxime Ripard

Ping?

Le 31/10/2012 10:12, Maxime Ripard a ?crit :

Quoted 31 lines

Hi everyone,

This patchset adds support for the solomon SSD1307 OLED controller present in the CFA-10036 board.

It first adds the framebuffer driver for this controller, and then the needed bits to enable it in the cfa10036 dts.

Considering that the driver has been around since almost three months now, and I have not received any comments on the framebuffer part, I'd very much like it to be included in 3.8 if possible.

Thanks,
Maxime

Changes from v5:
* Fixed bogus reset code

Maxime Ripard (2):
video: Add support for the Solomon SSD1307 OLED Controller
ARM: dts: mxs: add oled support for the cfa-10036

 .../devicetree/bindings/video/ssd1307fb.txt        |   24 ++
 arch/arm/boot/dts/imx28-cfa10036.dts               |   19 +
 drivers/video/Kconfig                              |   13 +
 drivers/video/Makefile                             |    1 +
 drivers/video/ssd1307fb.c                          |  407 ++++++++++++++++++++
 5 files changed, 464 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/ssd1307fb.txt
 create mode 100644 drivers/video/ssd1307fb.c
Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com