summaryrefslogtreecommitdiffstats
path: root/drivers/video/imx-ipu-fb.c
Commit message (Collapse)AuthorAgeFilesLines
* param: make parameter functions more consistentSascha Hauer2017-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_<type><access> "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask The improvement here is that we now can exactly specify the width of the int type parameters and also correctly distinguish between signed and unsigned variables which means that a variable no longer ends up with INT_MAX when it's assigned -1. "access" can be empty for regular read/write parameter, "_ro" for readonly parameters which get their value from a variable pointer in the background or "_fixed" for parameters which are set to a fixed value (without a pointer in the background). Some more exotic types are not (yet) implemented, like dev_add_param_ip_ro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework remap_rangeSascha Hauer2015-11-031-3/+2
| | | | | | | | | | | | | | | | | | remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipu-fb: mark internally used functions as staticLucas Stach2015-08-191-2/+4
| | | | | | | | | | | | | | Fixes symbol clashes with the IPUv3 driver: In function `ipu_ch_param_write_field': drivers/video/imx-ipu-v3/ipu-common.c:103: multiple definition of `ipu_ch_param_write_field' drivers/video/imx-ipu-fb.c:359: first defined here In function `ipu_cpmem_set_format_rgb': drivers/video/imx-ipu-v3/ipu-common.c:155: multiple definition of `ipu_cpmem_set_format_rgb' drivers/video/imx-ipu-fb.c:504: first defined here Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move DMA alloc functions to dma.hLucas Stach2015-03-061-0/+1
| | | | | | | | | | This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: change dma_alloc/free_coherent to match other architecturesLucas Stach2015-03-061-1/+2
| | | | | | | | | As a lot drivers currently rely on the 1:1 virt->phys mapping on ARM we define DMA_ADDRESS_BROKEN to mark them. In order to use them on other architectures with a different mapping they need proper fixing. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+2
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-04-041-5/+0
|\
| * drivers: treewide: Kill empty remove() implementationsAlexander Shiyan2014-04-021-5/+0
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | video: introduce struct display_timingsSascha Hauer2014-03-291-2/+2
|/ | | | | | | And use it inside struct fb_info. This struct has the advantage that the supported modes can be passed around in a single pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: Use uncached memory for framebufferSascha Hauer2013-12-201-2/+7
| | | | | | Otherwise funny caching artifacts can occur on the screen. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: imx-ipu-fb: Allow to specify framebuffer memory size via platform_dataSascha Hauer2013-12-201-2/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: imx-ipu-fb: Do not modify pwm registerSascha Hauer2013-12-201-5/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: Allow to disable fractional pixelclock dividerSascha Hauer2013-12-201-2/+9
| | | | | | | | The IPU has a fractional pixelclock divider. When used, this produces clock jitter which especially LVDS transceivers can't handle. Allow to disable it via platform_data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: Fix divider debug printSascha Hauer2013-12-201-1/+1
| | | | | | The fractional part is 4 bit, not 3 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: Fix 24bit format and implement 32bit formatSascha Hauer2013-12-201-1/+8
| | | | | | | | When requested 32bit formats the IPU generated a 24bit format instead. Implement real 32bit format (xxrrggbb) and let the IPU generate a 24bit format when requested. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: calculate channel param fields from fb_bitfieldsSascha Hauer2013-12-201-33/+59
| | | | | | | | No need to hardcode the channel parameters for the rgb offsets, we can calculate them from the fb_bitfields. ipu_ch_param_write_field() is the same as is the mainline IPUv3 driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: do not use bitfieldsSascha Hauer2013-12-201-142/+129
| | | | | | | | bitfields are not portable and one should make assumptions of the layout of bitfields. Replace them with the ipu_ch_param_write_field() which is already used in the mainline IPUv3 driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipufb: make disp_data_fmt configurableSascha Hauer2013-12-181-26/+18
| | | | | | | | With the IPU the way the display is connected is completely independent of the framebuffer pixel format. So instead of specifying a pixel width in platform_data we have to specify how the display is connected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: imx-ipu-fb: Use dev_add_param_int for alpha parameterSascha Hauer2013-04-111-17/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-7/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM i.MX: get rid of imx-regs.hSascha Hauer2012-10-171-1/+1
| | | | | | | | | - remove now unused __REG definitions - include individual SoC register files instead of imx-regs.h - move IMX_GPIO_NR to generic.h - finally remove imx-regs.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM i.MX35: Cleanup remaining unprefixed registersSascha Hauer2012-10-171-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-clk'Sascha Hauer2012-10-041-2/+8
|\
| * video i.MX IPU: Switch to clock supportSascha Hauer2012-10-041-2/+8
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
|/ | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: Add overlay supportTeresa Gámez2012-01-231-14/+143
| | | | | | | | | | | | | | Adding overlay support for i.MX3 sdc. Foreground channel only works when background is also enabled. The foreground video mode is always the same as the background. Also added alpha command to set the alpha value of the foreground. Tested on a phyCORE-i.MX35. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: Fix offset for IPU Clock.Teresa Gámez2012-01-231-1/+1
| | | | | | | | The offset for the IPU Clock in the CGR1 register is 18 not 22. See MCIMX35RM table 14-17. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: Add support for multiple video modesTeresa Gámez2012-01-231-1/+9
| | | | | | | Make support of multiple video modes possible for i.MX3 boards. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video i.MX ipu: convert to struct resourceSascha Hauer2011-07-191-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: i.MX IPU: fold mx3fb_set_par into its only userSascha Hauer2010-10-221-22/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: i.MX IPU: move fb_info initialization to a single functionSascha Hauer2010-10-221-28/+35
| | | | | | | | | | The bitfield information was only added to fb_info when the framebuffer actually was enabled. That made it impossible to call 'bmp' before enabling the display. So, move all fb_info init to a single place and make it a function to better allow for multiple displays later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: i.MX IPU: remove unnecessary printfSascha Hauer2010-10-221-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: set default bits per pixel at 16 for mx3Jean-Christophe PLAGNIOL-VILLARD2010-09-271-0/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: do not enable framebuffer on startupEric Bénard2010-06-301-2/+0
| | | | | | | | The board code or startup script should enable it when it actually wants to. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-ipu-fb: Add board specific hook to enable displayEric Bénard2010-06-301-0/+8
| | | | | Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix compile time errors when DEBUG is definedJuergen Beisert2010-02-121-2/+2
| | | | | | | | If the DEBUG macro is defined the compiler complains about a missing 'ipu_base' variable. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: Add a i.MX IPU framebuffer driverJuergen nogit Beisert2009-12-091-0/+919
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>