summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/ssd1307fb.c
AgeCommit message (Collapse)Author
2015-09-24fbdev: ssd1307fb: add ssd1309 supportOlliver Schinagl
The ssd1307fb driver supports a lot of chips from the ssd130xfb series. This patch adds the ssd1309 chip, a 128x64 OLED driver chip. It is very similar to the other chips and only has some definitions added to support it. Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-09-24fbdev: ssd1307fb: alphabetize headersOlliver Schinagl
This patch sorts the headers on ssd1307fb driver. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-09-01fbdev: ssd1307fb: fix error return codeJulia Lawall
Propagate error code on failure. Also changed %ld to %d in dev_err to use ret variable rather than putting two calls to PTR_ERR. A simplified version of the semantic match that finds the first problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-08-20video: fbdev: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: fix logical errorThomas Niederprüm
The logical not needs to be done after the bit masking. Fixes: a3998fe03e87 ("fbdev: ssd1307fb: Unify init code and obtain hw specific bits from DT") Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: potential ERR_PTR dereferenceDan Carpenter
The error handling got shifted down a few lines from where it was supposed to be for some reason. Fixes: a14a7ba8cb0f ('fbdev: ssd1307fb: add backlight controls for setting the contrast') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Add blank modeThomas Niederprüm
This patch adds ssd1307fb_blank() to make the framebuffer capable of blanking. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: add backlight controls for setting the contrastThomas Niederprüm
The backlight class is used to create userspace handles for setting the OLED contrast. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Turn off display on driver unload.Thomas Niederprüm
This patch turns off the display when the driver is unloaded. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Add a module parameter to set the refresh rateThomas Niederprüm
This patch adds the module parameter "refreshrate" to set delay for the deferred io. The refresh rate is given in units of Hertz. The default refresh rate is 1 Hz. The refresh rate set through the newly introduced parameter applies to all instances of the driver and for now it is not possible to change it individually. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Add support for SSD1305Thomas Niederprüm
This patch adds support for the SSD1305 OLED controller. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Unify init code and obtain hw specific bits from DTThomas Niederprüm
The 130X controllers are very similar from the configuration point of view. The configuration registers for the SSD1305/6/7 are bit identical (except the the VHCOM register and the the default values for clock setup register). This patch unifies the init code of the controller and adds hardware specific properties to DT that are needed to correctly initialize the device. The SSD130X can be wired to the OLED panel in various ways. Even for the same controller this wiring can differ from one display module to another and can not be probed by software. The added DT properties reflect these hardware decisions of the display module manufacturer. The 'com-sequential', 'com-lrremap' and 'com-invdir' values define different possibilities for the COM signals pin configuration and readout direction of the video memory. The 'segment-no-remap' allows the inversion of the memory-to-pin mapping ultimately inverting the order of the controllers output pins. The 'prechargepX' values need to be adapted according to the capacitance of the OLEDs pixel cells. So far these hardware specific bits are hard coded in the init code, making the driver usable only for one certain wiring of the controller. This patch makes the driver usable with all possible hardware setups, given a valid hw description in DT. If these values are not set in DT the default values, as they are set in the ssd1307 init code right now, are used. This implies that without the corresponding DT property "segment-no-remap" the segment remap of the ssd130X controller gets activated. Even though this is not the default behaviour according to the datasheet it maintains backward compatibility with older DTBs. Note that the SSD1306 does not seem to be using the configuration written to the registers at all. Therefore this patch does not try to maintain these values without changes in DT. For reference an example is added to the DT bindings documentation that reproduces the configuration that is set in the current init code. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Tested-by: Olliver Schinagl <o.schinagl@ultimaker.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: Allocate page aligned video memory.Thomas Niederprüm
Currently the videomemory is allocated by kmalloc, making it a memory region that is not necessarily page aligend. This leads to problems upon mmap call, where the video memory's address gets aligned to the next page boundary. The result is that the userspace program that issued the mmap call is not able to access the video memory from the start to the next page boundary. This patch changes the allocation of the video memory to use __get_free_pages() in order to obtain memory that is aligned to page boundaries. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-05-27fbdev: ssd1307fb: fix memory address smem_start.Thomas Niederprüm
the smem_start pointer of the framebuffer info struct needs to hold the physical address rather than the logical address. Right now the logical address returned by kmalloc is stored. This patch converts this address to a physical address and thus fixes a driver crash on mmaping the framebuffer memory due to an access to the wrong memory address. Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-01-30fbdev: ssd1307fb: return proper error code if write command failsPrabhakar Lad
this patch fixes ssd1307fb_ssd1306_init() function to return proper error codes in case of failures. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-01-15fbdev: ssd1307fb: set default height if not found in DT nodeLad, Prabhakar
this patch sets the default height if its not found in DT. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-01-15fbdev: ssd1307fb: drop unused function ssd1307fb_write_data()Lad, Prabhakar
this patch drops the unused function ssd1307fb_write_data(). Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-04-17video: move fbdev to drivers/video/fbdevTomi Valkeinen
The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers, fbdev framework files. Make some order into the chaos by creating drivers/video/fbdev directory, and move all fbdev related files there. No functionality is changed, although I guess it is possible that some subtle Makefile build order related issue could be created by this patch. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Clark <robdclark@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>