summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/simplefb.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-11video: fbdev: simplefb: Separate clk / regulator get and enable stepsHans de Goede1-16/+40
Currently when a simplefb needs both clocks and regulators and one of the regulators returns -EPROBE_DEFER when we try to get it, we end up disabling the clocks. This causes the screen to go blank; and in some cases my cause hardware state to be lost resulting in the framebuffer not working at all. This commit splits the get and enable steps and only enables clocks and regulators after successfully getting all of them, fixing the disabling of the clocks which were left enabled by the firmware setting up the simplefb. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2016-09-27simplefb: Disable and release clocks and regulators in destroy callbackChen-Yu Tsai1-3/+6
simplefb gets unregister when a proper framebuffer driver comes in and kicks it out. However the claimed clocks and regulators stay enabled as they are only released in the platform device remove function, which in theory would never get called. Move the clock/regulator cleanup into the framebuffer destroy callback, which gets called as part of the framebuffer unregister process. Note this introduces asymmetry in how the resources are claimed and released. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-09-27video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structuresJulia Lawall1-2/+2
These structures are only used to copy into other structures, so declare them as const. The semantic patch that makes this change in the fb_fix_screeninfo case is as follows (http://coccinelle.lip6.fr/). The fb_var_screeninfo case is analogous. // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct fb_fix_screeninfo i@p = { ... }; @ok@ identifier r.i; expression e; position p; @@ e = i@p @bad@ position p != {r.p,ok.p}; identifier r.i; struct fb_fix_screeninfo e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct fb_fix_screeninfo i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-02-27simplefb: Remove impossible check for of_clk_get_parent_count() < 0Stephen Boyd1-2/+2
The check for < 0 is impossible now that of_clk_get_parent_count() returns an unsigned int. Simplify the code and update the types. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: <linux-fbdev@vger.kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2015-12-15simplefb: Claim and enable regulatorsChen-Yu Tsai1-1/+119
This claims and enables regulators listed in the simple framebuffer dt node. This is needed so that regulators powering the display pipeline and external hardware, described in the device node and known by the kernel code, will remain properly enabled. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2015-07-20simplefb: Include clk.hStephen Boyd1-0/+1
This driver uses the consumer API, so include clk.h explicitly instead of impliclty through the provider API. Cc: Luc Verhaegen <libv@skynet.be> Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: David Herrmann <dh.herrmann@gmail.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2015-01-13simplefb: Fix build failure on SparcHans de Goede1-1/+1
of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set, which is normally always the case when CONFIG_OF is defined, except on Sparc, so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-12-15Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-11-25simplefb: Fix build errors when CONFIG_COMMON_CLK is not definedHans de Goede1-2/+2
Both CONFIG_OF and CONFIG_COMMON_CLK must be defined to be able to use of clocks. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-11-14simplefb: Change simplefb_init from module_init to fs_initcallHans de Goede1-1/+1
One of the reasons for having the simplefb nodes in /chosen, and doing explicit enumeration of the nodes there, is too allow enumerating them sooner, so that we get a console earlier on. Doing this earlier then fs_initcall is not useful, since the fb only turns into a console when fbcon intializes, which is a fs_initcall too. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-11-14simplefb: Add support for enumerating simplefb dt nodes in /chosenHans de Goede1-1/+22
Update simplefb to support the new preferred location for simplefb dt nodes under /chosen. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-11-14simplefb: add clock handling codeLuc Verhaegen1-1/+107
This claims and enables clocks listed in the simple framebuffer dt node. This is needed so that the display engine, in case the required clocks are known by the kernel code and are described in the dt, will remain properly enabled. Signed-off-by: Luc Verhaegen <libv@skynet.be> [hdegoede@redhat.com: Change clks from list to dynamic array] Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-11-14simplefb: add goto error path to probeLuc Verhaegen1-7/+11
Use the usual kernel style of goto error_foo to free resources on probe error. This is a preparation patch for adding clocks support. While at it also update ioremap_wc error return from ENODEV to ENOMEM. Signed-off-by: Luc Verhaegen <libv@skynet.be> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-11-14simplefb: formalize pseudo palette handlingLuc Verhaegen1-3/+12
Add a proper struct describing simplefb private data, with the palette in there, instead of directly storing the palette in the fb_info->par pointer. Signed-off-by: Luc Verhaegen <libv@skynet.be> Acked-by: Stephen Warren <swarren@nvidia.com> [hdegoede@redhat.com: drop unnecessary void * cast] Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-10-20video: fbdev: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-04-17video: move fbdev to drivers/video/fbdevTomi Valkeinen1-0/+280
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>