platform/kernel/linux-exynos.git
5 years agodrm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes
Marek Szyprowski [Tue, 29 May 2018 08:18:47 +0000 (10:18 +0200)]
drm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes

Fix Cb/CR components order in two-planar YUV420, YUV422 and YUV444 modes.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib71dd82d3a0cd9e742d97a18b4999f8d22a0c544

5 years agodrm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels
Marek Szyprowski [Mon, 28 May 2018 12:34:39 +0000 (14:34 +0200)]
drm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels

Investigation revealed that GScaler hardware requires the real buffer width
(pitch) to be aligned to 16 pixels.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I27ddbdb73fdcdfbfc4b90e76242196f72be91c98

5 years agodrm/exynos: gsc: Use real buffer width for configuring the hardware
Marek Szyprowski [Mon, 28 May 2018 12:10:14 +0000 (14:10 +0200)]
drm/exynos: gsc: Use real buffer width for configuring the hardware

DMA hardware should respect buffer pitch, so use the width calculated from
the buffer pitch instead of the virtual one.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id35299775cb6064e4c0af4542c34061223ff9d16

5 years agodrm/exynos: ipp: Rework checking for the correct buffer formats
Marek Szyprowski [Mon, 28 May 2018 12:03:20 +0000 (14:03 +0200)]
drm/exynos: ipp: Rework checking for the correct buffer formats

Prepare a common function for size and scale checks and call it for
source and destination buffers. Then also move there the state-less checks
from exynos_drm_ipp_task_setup_buffer, so the format information is already
available in limits processing. Finally perform the IPP_LIMIT_BUFFER check
on the real width of the buffer (the width calculated from the provided
buffer pitch).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I7bd24c4448f27abf5dcbcf19045d30bbcdd4ee87

5 years agodrm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation
Marek Szyprowski [Fri, 25 May 2018 11:02:55 +0000 (13:02 +0200)]
drm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in Rotator driver. Fix this by swapping code for interpreting
them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic6aef7b463ebb89fd217092f129427303102641b

5 years agodrm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation
Marek Szyprowski [Fri, 25 May 2018 11:02:26 +0000 (13:02 +0200)]
drm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in GScaler driver. Fix this by swapping code for interpreting
them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie442b31ef85f698e163af1a4c745311c9074ceb3

5 years agodrm/exynos: scaler: Reset hardware before starting the operation
Andrzej Pietrasiewicz [Mon, 5 Feb 2018 15:41:54 +0000 (16:41 +0100)]
drm/exynos: scaler: Reset hardware before starting the operation

Ensure that Scaler hardware is properly reset and interrupts are cleared
before processing next image.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I036118b95bdf37e1c6dd133606746f2d6fce4758

5 years agodrm/exynos: decon: Add support for hardware windows no 4 and 5
Marek Szyprowski [Wed, 23 May 2018 09:21:19 +0000 (11:21 +0200)]
drm/exynos: decon: Add support for hardware windows no 4 and 5

Enable support for 2 more hardware windows. This require enabling a few
more clocks and set proper plane type for all windows. In the new
configuration primary plane uses hardware window no 3 and cursor uses
window no 5. The remaining hardware windows are used for overlays. This
gives us an overlay plane both below and above primary plane for both
Decon and DeconTV (which uses hardware window nr 0 for background).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I1c9947d040cb9af24dd7b7ec5ce7aa80845d3c9b

5 years agodrm/exynos: Fix default value for zpos plane property
Marek Szyprowski [Wed, 23 May 2018 09:14:53 +0000 (11:14 +0200)]
drm/exynos: Fix default value for zpos plane property

The default zpos property for all planes in Exynos DRM was fixed as zero.
Fix this by providing proper value provided by hardware drivers, which
typically matches hardware window number.

Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie7caf48e2560d05338778a2d71f1d7f0016a9950

5 years agoarm64: dts: exynos: Add more clocks to Exynos5433 Decon and DeconTV
Marek Szyprowski [Wed, 23 May 2018 09:12:27 +0000 (11:12 +0200)]
arm64: dts: exynos: Add more clocks to Exynos5433 Decon and DeconTV

Add all '1x' clocks to decon and decontv devices. Enabling those clocks
is needed to get proper display on hardware windows no 4 and 5.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I47043438d55591f0202e8ddf3cf4cf86bfa4a9f3

5 years agoarm64: dts: exynos: Remove duplicated entries from exynos5433-tm2e.dts
Sylwester Nawrocki [Thu, 26 Apr 2018 12:03:25 +0000 (14:03 +0200)]
arm64: dts: exynos: Remove duplicated entries from exynos5433-tm2e.dts

There are already proper dts entries in exynos5433-tm2-common.dtsi
which can be reused also for TM2e.

Change-Id: I269bef96efa8dc68f9ca9d59e07a9bd862a9d46a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agoarm64: dts: exynos: Fix ldo25_reg regulator name for tm2e
Sylwester Nawrocki [Thu, 26 Apr 2018 12:00:30 +0000 (14:00 +0200)]
arm64: dts: exynos: Fix ldo25_reg regulator name for tm2e

The S2MPS13 LDO25 regulator is needed for camera sensor on TM2e
boards, without this change both cameras fail on TM2e.
The fimc-is driver handles regulators in a non-standard way and
it expects specific regulator device name.

Change-Id: Ie8b0200fac333fa1c1851549de834051144b926a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS
Sylwester Nawrocki [Thu, 19 Apr 2018 13:37:52 +0000 (15:37 +0200)]
spi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS

This a workaround to avoid errors in SPI transfer when camera devices
are closed and shortly after re-opened.

Change-Id: I239463f6eefe56a644ec63c42daedb455cf91202
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove dubious spin_(un)lock_irq() use
Sylwester Nawrocki [Thu, 19 Apr 2018 12:09:33 +0000 (14:09 +0200)]
fimc-is: Remove dubious spin_(un)lock_irq() use

There should not be a need to use spin_lock_irq/spin_unlock_irq
in those critical sections. spin_unlock_irq() enables interrupts
unconditionally which can be harmful.

Change-Id: I29df4e56475a56a94762bb1585a6ba3d55c45259
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Suppress warning generated in fimc_is_group_buffer_finish()
Sylwester Nawrocki [Thu, 19 Apr 2018 12:04:41 +0000 (14:04 +0200)]
fimc-is: Suppress warning generated in fimc_is_group_buffer_finish()

Due to videobuf2 queue cancel call fimc_is_group_buffer_finish() function
may be called with invalid group->id. Just return EINVAL instead of WARN_ON()
when group->id has GROUP_ID_INVALID value so as to avoid unneeded stack dumps
in kernel log while closing video device nodes.

Change-Id: I3c5d6fec997ceaf5ae28e2537cfbca9405040bb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Release all buffers in sensor video node stop_streaming() callback
Sylwester Nawrocki [Fri, 20 Apr 2018 10:32:08 +0000 (12:32 +0200)]
fimc-is: Release all buffers in sensor video node stop_streaming() callback

Any buffer owned by a driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.

Change-Id: Ib7f8b0b8fffe50f387827929829e3e87c0f1bf38
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Release all buffers in fimc_is_queue_stop_streaming()
Sylwester Nawrocki [Thu, 19 Apr 2018 11:58:43 +0000 (13:58 +0200)]
fimc-is: Release all buffers in fimc_is_queue_stop_streaming()

Any buffer owned by the driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.

Change-Id: Idd2f3157ab5c0326c39e8d9160514ad6102301b6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agoarm64: configs: tizen_tm2_defconfig update camera driver
Sylwester Nawrocki [Thu, 29 Mar 2018 09:16:59 +0000 (11:16 +0200)]
arm64: configs: tizen_tm2_defconfig update camera driver

Enable camera driver.

Change-Id: I17644b593b9bd59b1055309633900240c2a30e50
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Convert bool to unsigned int to fix bool-operation
Seung-Woo Kim [Thu, 22 Mar 2018 06:36:31 +0000 (15:36 +0900)]
fimc-is: Convert bool to unsigned int to fix bool-operation

Convert bool to unsigned in to fix bool-operation warnings with gcc7.

Change-Id: I04147f628198204e2b1ecc3b3f04a63a61f62c7b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: SPI related functions clean up
Sylwester Nawrocki [Thu, 12 Apr 2018 15:17:25 +0000 (17:17 +0200)]
fimc-is: SPI related functions clean up

Replace explicit memset() calls with initialization to 0 at declaration time.

Change-Id: I56068b22577494c59d85e94af439234f56ed1fdd
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix cs_change flags in SPI transfers
Sylwester Nawrocki [Thu, 12 Apr 2018 15:10:10 +0000 (17:10 +0200)]
fimc-is: Fix cs_change flags in SPI transfers

The cs_change flags need to be adjusted so SPI communications works
properly with the spi-s3c64xx driver.

Change-Id: I73ae345670e9ac79d8b8b576dc25078ece6167e7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove redundant "fimc_is_spi1" driver
Sylwester Nawrocki [Mon, 9 Apr 2018 16:35:51 +0000 (18:35 +0200)]
fimc-is: Remove redundant "fimc_is_spi1" driver

Change-Id: I0e372c47298d4869e0d5041a968e8ef84429d1da
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove unused SPI driver code
Sylwester Nawrocki [Fri, 6 Apr 2018 10:02:31 +0000 (12:02 +0200)]
fimc-is: Remove unused SPI driver code

This patch removes empty/unused SPI related functions and unneeded
devinit/devexit attribute definitions.

Change-Id: I98055d7947c15d0c6692d8714469f48ed9aeffb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agophy: exynos-mipi-video: Simplify code by using regmap_update_bits()
Sylwester Nawrocki [Fri, 6 Apr 2018 14:27:05 +0000 (16:27 +0200)]
phy: exynos-mipi-video: Simplify code by using regmap_update_bits()

Change-Id: I89144594f128b73a3c0c38ab7fd2536b34ef9768
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix memory leak in clock operations
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Fix memory leak in clock operations

devm_clk_get() allocates new struct clk which will be freed only during
the driver's deinitialization which actually never happens.

Change-Id: I94c1d42f3c1b053406437b4baf6c81577b53416b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agodts: arm64: exynos5433-tm2: Use only I2C child node for companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 16:08:42 +0000 (18:08 +0200)]
dts: arm64: exynos5433-tm2: Use only I2C child node for companion device

Change-Id: Id75be47aa2d4012e7acd263f9059dfce775ff8c5
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Get rid of companion platform driver
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Get rid of companion platform driver

Change-Id: I2d9d6c690b867234ec8918747eec88d8593e44f1
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use struct device * for companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 14:35:44 +0000 (16:35 +0200)]
fimc-is: Use struct device * for companion device

Change-Id: I365f652a10d62b4949561b673de93774fbae77a6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use common struct v4l2_device for the companion device
Sylwester Nawrocki [Thu, 5 Apr 2018 14:12:38 +0000 (16:12 +0200)]
fimc-is: Use common struct v4l2_device for the companion device

Change-Id: Ia72b932676281dd972312e89d663ab096b4dbf79
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use struct device rather than struct platform_device
Sylwester Nawrocki [Thu, 5 Apr 2018 13:46:28 +0000 (15:46 +0200)]
fimc-is: Use struct device rather than struct platform_device

Change-Id: Ief3d4c4356b66e900bd76dc1bdecca02420916ae
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agoarm64: dts: exynos5433-tm2: Add camera device nodes
Sylwester Nawrocki [Mon, 16 Apr 2018 13:24:55 +0000 (15:24 +0200)]
arm64: dts: exynos5433-tm2: Add camera device nodes

Change-Id: I003c2a2ddeeea63168a4ff382eea783edd808937
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agoarm64: dts: exynos5433-tm2: Correct s2mps13 LDO23 regulator definition
Sylwester Nawrocki [Mon, 26 Mar 2018 15:58:02 +0000 (17:58 +0200)]
arm64: dts: exynos5433-tm2: Correct s2mps13 LDO23 regulator definition

Change-Id: I276496ef0223be2adc9aafefa86d790485042844
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agoarm64: dts: exynos5433: Add FIMC-IS subsystem nodes
Sylwester Nawrocki [Fri, 23 Mar 2018 16:53:48 +0000 (17:53 +0100)]
arm64: dts: exynos5433: Add FIMC-IS subsystem nodes

Change-Id: I489d4000217c1780cd7caac7469eb93345adb1fb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Set all buffer queues as bidirectional
Sylwester Nawrocki [Tue, 3 Apr 2018 13:34:36 +0000 (15:34 +0200)]
fimc-is: Set all buffer queues as bidirectional

This prevent SYSMMU fault from FIMC-IS CPU access:

[   42.220252] exynos-sysmmu 142d0000.sysmmu: 14180000.fimc_is: AW ACCESS PROTECTION FAULT occurred at 0x7ff98af0
[   42.220634] ------------[ cut here ]------------
[   42.222578] kernel BUG at drivers/iommu/exynos-iommu.c:449!
[   42.228136] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[   42.233602] Modules linked in:
[   42.236641] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W       4.14.24+ #154
[   42.244105] Hardware name: Samsung TM2 board (DT)
[   42.248790] task: ffffff800905eb80 task.stack: ffffff8009040000
[   42.254699] PC is at exynos_sysmmu_irq+0x17c/0x188
[   42.259468] LR is at exynos_sysmmu_irq+0x108/0x188
[   42.264241] pc : [<ffffff80084d68b4>] lr : [<ffffff80084d6840>] pstate: 600001c5
[   42.271620] sp : ffffff8008003e00
[   42.274915] x29: ffffff8008003e00 x28: ffffff8009031010
[   42.280211] x27: ffffff8009043db0 x26: ffffff8009031000
[   42.285506] x25: ffffff800913c000 x24: 000000007ff98af0
[   42.290800] x23: ffffffc0c9c4a918 x22: 0000000000000064
[   42.296095] x21: ffffffc0c9c4a958 x20: 0000000000000013
[   42.301390] x19: ffffff8008ad87c8 x18: 0000000000000010
[   42.306685] x17: 0000000000000000 x16: fffffffffffffffe
[   42.311980] x15: ffffff8089180f9f x14: 0720072007200720
[   42.317275] x13: 0720072007200720 x12: 0720072007200720
[   42.322569] x11: 0720072007200720 x10: 0720072007200720
[   42.327864] x9 : 0720072007200720 x8 : 0720072007200720
[   42.333159] x7 : 0720072007200720 x6 : 00000000000003cb
[   42.338454] x5 : 0000000000000000 x4 : 0000000000000000
[   42.343748] x3 : 0000000000000001 x2 : 000000007ff98af0
[   42.349044] x1 : ffffff8009140c80 x0 : 00000000ffffffda
[   42.354340] Process swapper/0 (pid: 0, stack limit = 0xffffff8009040000)
[   42.361024] Call trace:
[   42.363451] Exception stack(0xffffff8008003cc0 to 0xffffff8008003e00)
[   42.369879] 3cc0: 00000000ffffffda ffffff8009140c80 000000007ff98af0 0000000000000001
[   42.377692] 3ce0: 0000000000000000 0000000000000000 00000000000003cb 0720072007200720
[   42.385504] 3d00: 0720072007200720 0720072007200720 0720072007200720 0720072007200720
[   42.393317] 3d20: 0720072007200720 0720072007200720 0720072007200720 ffffff8089180f9f
[   42.401128] 3d40: fffffffffffffffe 0000000000000000 0000000000000010 ffffff8008ad87c8
[   42.408940] 3d60: 0000000000000013 ffffffc0c9c4a958 0000000000000064 ffffffc0c9c4a918
[   42.416753] 3d80: 000000007ff98af0 ffffff800913c000 ffffff8009031000 ffffff8009043db0
[   42.424564] 3da0: ffffff8009031010 ffffff8008003e00 ffffff80084d6840 ffffff8008003e00
[   42.432376] 3dc0: ffffff80084d68b4 00000000600001c5 ffffff8008ad87c8 0000000000000013
[   42.440189] 3de0: 0000007fffffffff 0000000000000064 ffffff8008003e00 ffffff80084d68b4
[   42.448001] [<ffffff80084d68b4>] exynos_sysmmu_irq+0x17c/0x188
[   42.453817] [<ffffff80080f4b14>] __handle_irq_event_percpu+0x64/0x280
[   42.460238] [<ffffff80080f4d4c>] handle_irq_event_percpu+0x1c/0x58
[   42.466400] [<ffffff80080f4dd0>] handle_irq_event+0x48/0x78
[   42.471956] [<ffffff80080f8a34>] handle_fasteoi_irq+0xbc/0x1b0
[   42.477772] [<ffffff80080f3bac>] generic_handle_irq+0x24/0x38
[   42.483499] [<ffffff80080f426c>] __handle_domain_irq+0x84/0xf8
[   42.489315] [<ffffff80080817c8>] gic_handle_irq+0x68/0xc8
[   42.494695] Exception stack(0xffffff8009043db0 to 0xffffff8009043ef0)
[   42.501119] 3da0:                                   0000000000000000 ffffff8008e3c628
[   42.508934] 3dc0: ffffff8009031010 0000000000000001 00000040d657b000 0000000000005dc0
[   42.516746] 3de0: 0000000000000008 0000000000000000 0000000000000002 ffffff8009043e70
[   42.524558] 3e00: 0000000000000980 000000000011fa88 0000000000000000 0000000000000001
[   42.532370] 3e20: 0000000000000000 ffffff8089180f9f fffffffffffffffe 0000000000000000
[   42.540183] 3e40: 0000000000000010 ffffff800913c000 ffffff800913ce78 0000000000000000
[   42.547993] 3e60: ffffff8008e1ee50 0000000000000000 0000000000000000 ffffff800905eb80
[   42.555806] 3e80: 00000000df6e4808 0000000000000000 0000000020f80018 ffffff8009043ef0
[   42.563618] 3ea0: ffffff8008085de0 ffffff8009043ef0 ffffff8008085de4 0000000060000145
[   42.571430] 3ec0: ffffff800903b048 ffffff8008e1ee50 ffffffffffffffff ffffff8009052000
[   42.579241] 3ee0: ffffff8009043ef0 ffffff8008085de4
[   42.584100] [<ffffff8008083130>] el1_irq+0xb0/0x124
[   42.588962] [<ffffff8008085de4>] arch_cpu_idle+0x34/0x1c8
[   42.594344] [<ffffff80080e2b1c>] do_idle+0x114/0x1e0
[   42.599289] [<ffffff80080e2d84>] cpu_startup_entry+0x24/0x28
[   42.604935] [<ffffff8008a390c8>] rest_init+0xc8/0xd8
[   42.609883] [<ffffff8008f80b94>] start_kernel+0x39c/0x3b0
[   42.615264] Code: 2a1803e4 9401e0bc f94032e0 b5fffbe0 (d4210000)
[   42.621339] ---[ end trace f42ebbac31eb0484 ]---

Change-Id: I2467a1646a6c6cdcb6898fd4911cb64f9f0d658e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Drop code for old kernel versions
Sylwester Nawrocki [Thu, 29 Mar 2018 13:57:30 +0000 (15:57 +0200)]
fimc-is: Drop code for old kernel versions

Change-Id: If303fd1f7546df825b6c9399791d1044ec92630a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc: Add missing memory allocator initialization for companion video node
Sylwester Nawrocki [Thu, 29 Mar 2018 13:56:06 +0000 (15:56 +0200)]
fimc: Add missing memory allocator initialization for companion video node

Change-Id: Ib8b910a54d024609a1c8e4dc675b2d61976531c0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Enable build
Marek Szyprowski [Thu, 6 Aug 2015 13:39:42 +0000 (15:39 +0200)]
fimc-is: Enable build

Change-Id: I58682e769f517bb32d9a1a65b024a548ce20884a
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove unused Kconfig entry
Sylwester Nawrocki [Thu, 29 Mar 2018 10:35:50 +0000 (12:35 +0200)]
fimc-is: Remove unused Kconfig entry

CONFIG_OIS_FW_UPDATE_THREAD_USE is not used anywhere in the driver code.

Change-Id: I548a1793ccd9605fec24556cfbd1be36d5856827
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Enable required components in Kconfig by default
Sylwester Nawrocki [Tue, 27 Mar 2018 12:43:34 +0000 (14:43 +0200)]
fimc-is: Enable required components in Kconfig by default

Change-Id: Ia2d71205a997e551724ada9009aaf88dd9500669
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Adapt to latest changes DMA-mapping/IOMMU frameworks
Marek Szyprowski [Thu, 6 Aug 2015 08:03:46 +0000 (10:03 +0200)]
fimc-is: Adapt to latest changes DMA-mapping/IOMMU frameworks

This patch is a temporary workaround.

31-bit DMA mask is used to prevent overlapping with the Cortex-A5
reserved range. FIMC-IS CPU uses 0xe0000000-0xffffffff address
range for mapping peripheral devices, so those addresses must not
be used for memory buffers.

Change-Id: I74599b8037644bf7582043ac17a098d49b11193c
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove redundant memory allocation error log
Sylwester Nawrocki [Fri, 23 Mar 2018 17:14:09 +0000 (18:14 +0100)]
fimc-is: Remove redundant memory allocation error log

kzalloc() generates stack trace on errors.

Change-Id: I73a530a18a20e7e6d9aa73daec3e89357b1c1570
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Adaptation to kthread API changes
Sylwester Nawrocki [Wed, 21 Mar 2018 16:53:04 +0000 (17:53 +0100)]
fimc-is: Adaptation to kthread API changes

Change-Id: I0ef434f7c5a9a18348feaa391bb6a601d107e028
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use ktime_get_ts() instead of do_posix_clock_monotonic_gettime
Sylwester Nawrocki [Wed, 21 Mar 2018 16:25:43 +0000 (17:25 +0100)]
fimc-is: Use ktime_get_ts() instead of do_posix_clock_monotonic_gettime

do_posix_clock_monotonic_gettime() is not available any more in kernel v4.14.

Change-Id: Ib9a5a1d1069e6ad7d593f8eddc0801f418163a16
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Adaptation to V4L2 API changes
Sylwester Nawrocki [Wed, 21 Mar 2018 16:24:35 +0000 (17:24 +0100)]
fimc-is: Adaptation to V4L2 API changes

Change-Id: Ia944801f9bd161bb4381b679a0d0b6920bb3d35d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove BUG() from fimc_is_itf_s_param()
Sylwester Nawrocki [Mon, 21 Aug 2017 16:19:50 +0000 (18:19 +0200)]
fimc-is: Remove BUG() from fimc_is_itf_s_param()

The condition being tested for that BUG() invocation is often
recoverable, so replace BUG() with a WARN_ON() and return EINVAL.
This prevents specific user space call sequences crashing the kernel,
which should never happen.
The callers of fimc_is_itf_s_param() function will be updated in
subsequent patches if necessary, to prevent any further possible
crashes.

Change-Id: I90a08278baa0cee85a4a69fa1b278e28e5c6764a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: change metadata header as uapi header
Seung-Woo Kim [Thu, 22 Jun 2017 09:41:20 +0000 (18:41 +0900)]
fimc-is: change metadata header as uapi header

The header fimc-is-metadata.h is required from user, so it should
be a uapi header. So this patch moves the header to uapi header.

Change-Id: I5618889c806d4463da0bf0ea947bf5d1b667d5e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agofimc-is: Rename "is fail" to "failed"
Sylwester Nawrocki [Thu, 3 Mar 2016 15:27:59 +0000 (16:27 +0100)]
fimc-is: Rename "is fail" to "failed"

Change-Id: Ifd587dd48cf28d91250814499b881198cc039229
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Add proper implementation of fimc_is_ischain_forcedown()
Sylwester Nawrocki [Fri, 11 Mar 2016 15:08:37 +0000 (16:08 +0100)]
fimc-is: Add proper implementation of fimc_is_ischain_forcedown()

Change-Id: I1f9314050dd9ca52623dd1770ccef3fa8b3755d6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: MCUCTL register definition cleanup
Sylwester Nawrocki [Thu, 10 Mar 2016 16:46:47 +0000 (17:46 +0100)]
fimc-is: MCUCTL register definition cleanup

Lots of (mostly unused) postfix-indexed macro definitions
are now replaced with parametric definitions.

Change-Id: I86280b01681dfd25915ba7001af2e69c84369032
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove unused data structure declaration
Sylwester Nawrocki [Thu, 10 Mar 2016 16:24:27 +0000 (17:24 +0100)]
fimc-is: Remove unused data structure declaration

Change-Id: I8ba9ae47aab00f4dfad1724a92e4659cca91588b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Clear all MCUCTL register in the power up sequence
Sylwester Nawrocki [Thu, 10 Mar 2016 16:43:00 +0000 (17:43 +0100)]
fimc-is: Clear all MCUCTL register in the power up sequence

When the ISP, CAM{0,1} power domains are always on it is required
to clear MCUCTL registers in the ISP power up sequence, otherwise
the front camera is not working properly if previously the rear
camera pipeline was used. The original code relied on the MCUCTL
registers being reset to default values after the ISP power domain
switch off/on cycle.

Change-Id: I685603ab968e5eb3871dd0ed3a25a4eb694bdc75
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Reconfigure more muxes to oscclk in the power off sequence
Sylwester Nawrocki [Fri, 4 Mar 2016 16:56:32 +0000 (17:56 +0100)]
fimc-is: Reconfigure more muxes to oscclk in the power off sequence

We don't switch off CAM1, CAM0, ISP power domain so reconfigure
more muxes to their default after reset state duriong power off
sequence.

Change-Id: I85161973d654268acd741f36210f5d8aee8c1ec9
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Workaround for ACLK_CAM1_552_USER configuration issues
Sylwester Nawrocki [Mon, 29 Feb 2016 15:03:26 +0000 (16:03 +0100)]
fimc-is: Workaround for ACLK_CAM1_552_USER configuration issues

For some reason "mout_aclk_cam1_552_user" clock reconfiguration from
"oscclk" to "aclk_cam1_552" breaks the front camera operation (often
only empty buffer are dequeued). But it is required for the rear
camera. Until the root cause is found reconfigure the mux conditionally
only for the rear sensor operation.

Change-Id: If121971afa4007efc778bde452ff95e75f20dced
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix compiler warning
Sylwester Nawrocki [Thu, 3 Mar 2016 15:30:54 +0000 (16:30 +0100)]
fimc-is: Fix compiler warning

n file included from drivers/media/platform/exynos/fimc-is/fimc-is-companion-dt.c:23:0:
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: 'struct fimc_is_core' declared inside parameter list
 int fimc_is_parse_children_dt(struct device *dev, struct fimc_is_core *core);
                                                          ^
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: its scope is only this definition or declaration, which is probably not what you want

Change-Id: I8848007ce5de95574699a735c19bad195f0bd3cb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Add setting of vendorSpecific2[0] metadata structure field
Sylwester Nawrocki [Fri, 26 Feb 2016 16:33:50 +0000 (17:33 +0100)]
fimc-is: Add setting of vendorSpecific2[0] metadata structure field

vendorSpecific2[0] value pattern depends on the fimc-is firmware
revision. Move setting up of this field to the kernel as there is
all information required for this.
The driver will update the field accordingly only if user space
leaves it cleared.

Change-Id: Ib77d7be7081a2239a19912757392522d044d58f9
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clock
Sylwester Nawrocki [Fri, 26 Feb 2016 16:02:46 +0000 (17:02 +0100)]
fimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clock

When CLK_MOUT_ACLK_CAM1_552_USER clock is properly defined
in clk-exynos5433.c re-parenting commented out in this patch
causes that only empty buffers can be dequeued from the scaler
for front camera. So re-parenting is disabled for now until
we can address this issue in a better way.

Change-Id: I6198a5f8945638ec0002a071d8f4865920790d00
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()
Sylwester Nawrocki [Fri, 6 Nov 2015 13:33:22 +0000 (14:33 +0100)]
fimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()

This prevents kernel panic caused by wrong sequences in user space.

Change-Id: I1470675c0a2a2bcecb526dbef0f93772c5da9cb4
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix code issues pointed by CPPTest tool
Marek Szyprowski [Tue, 24 Nov 2015 09:33:57 +0000 (10:33 +0100)]
fimc-is: Fix code issues pointed by CPPTest tool

Change-Id: I2d717c6eca79bc213e98448666cc0f88995bb00e
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Fix possible memory leak found by static analysis
Marek Szyprowski [Mon, 23 Nov 2015 12:55:49 +0000 (13:55 +0100)]
fimc-is: Fix possible memory leak found by static analysis

This patch fixes all issues pointed by Klocwork static analysis tool.

Change-Id: Ie0d80a2bbd514c6dac0959784623d380ea580b19
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: 6d1: add sentinel element to id table
Seung-Woo Kim [Tue, 1 Sep 2015 08:21:01 +0000 (17:21 +0900)]
fimc-is: 6d1: add sentinel element to id table

This patch adds sentinel element to id table to fix following out
of bounds access:
    ==================================================================
    BUG: KASan: out of bounds access in i2c_device_match+0xcc/0xf0 at addr ffffffc00120ee80
    Read of size 1 by task swapper/0/1
    page:ffffffbdc0848380 count:1 mapcount:0 mapping:          (null) index:0x0
    flags: 0x400(reserved)
    page dumped because: kasan: bad access detected
    Address belongs to variable sensor_6d1_idt+0x20/0x40
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.0-00839-gb91c2a6-dirty #3
    Hardware name: Samsung TM2 board (DT)
    Call trace:
    [<ffffffc00008bc58>] dump_backtrace+0x0/0x1d8
    [<ffffffc00008be40>] show_stack+0x10/0x20
    [<ffffffc000eee3a4>] dump_stack+0x80/0xd4
    [<ffffffc00021e4f0>] kasan_report_error+0x3e0/0x408
    [<ffffffc00021e9ec>] kasan_report+0x44/0x50
    [<ffffffc00021d8f0>] __asan_load1+0x78/0x80
    [<ffffffc000916b78>] i2c_device_match+0xc8/0xf0
    [<ffffffc0006d9d54>] __driver_attach+0x3c/0xd0
    [<ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138
    [<ffffffc0006d932c>] driver_attach+0x2c/0x40
    [<ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8
    [<ffffffc0006dab40>] driver_register+0xb0/0x1c0
    [<ffffffc000917fc0>] i2c_register_driver+0x48/0xc8
    [<ffffffc001795344>] sensor_6d1_load+0x18/0x24
    [<ffffffc000082ae4>] do_one_initcall+0xec/0x240
    [<ffffffc001755e50>] kernel_init_freeable+0x288/0x330
    [<ffffffc000eeab1c>] kernel_init+0xc/0xf0
    Memory state around the buggy address:
     ffffffc00120ed80: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa
     ffffffc00120ee00: fa fa fa fa 00 00 06 fa fa fa fa fa 00 00 00 00
    >ffffffc00120ee80: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
                       ^
     ffffffc00120ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     ffffffc00120ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ==================================================================

Change-Id: I9db130c66d2aa884b946e946581e5dc08f8a20ca
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agofimc-is: Fix wrong index access for dt child nodes
Seung-Woo Kim [Tue, 1 Sep 2015 07:59:03 +0000 (16:59 +0900)]
fimc-is: Fix wrong index access for dt child nodes

This patch fixes wrong index access for dt child nodes. This fixes
following use after free:
    ==================================================================
    BUG: KASan: use after free in fimc_is_parse_children_dt+0x6c/0xe8 at addr ffffffc08d27ffa8
    Write of size 8 by task swapper/0/1
    page:ffffffbdc2b49fc0 count:0 mapcount:0 mapping:          (null) index:0x0
    flags: 0x0()
    page dumped because: kasan: bad access detected
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.0-00839-gb91c2a6-dirty #3
    Hardware name: Samsung TM2 board (DT)
    Call trace:
    [<ffffffc00008bc58>] dump_backtrace+0x0/0x1d8
    [<ffffffc00008be40>] show_stack+0x10/0x20
    [<ffffffc000eee3a4>] dump_stack+0x80/0xd4
    [<ffffffc00021e510>] kasan_report_error+0x400/0x408
    [<ffffffc00021e9ec>] kasan_report+0x44/0x50
    [<ffffffc00021d38c>] __asan_store8+0x94/0xb0
    [<ffffffc000991900>] fimc_is_parse_children_dt+0x68/0xe8
    [<ffffffc000959368>] fimc_is_probe+0xc0/0xed8
    [<ffffffc0006dc724>] platform_drv_probe+0x64/0xf8
    [<ffffffc0006d9ae8>] driver_probe_device+0x1f0/0x3a8
    [<ffffffc0006d9de0>] __driver_attach+0xc8/0xd0
    [<ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138
    [<ffffffc0006d932c>] driver_attach+0x2c/0x40
    [<ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8
    [<ffffffc0006dab40>] driver_register+0xb0/0x1c0
    [<ffffffc0006dc618>] __platform_driver_register+0xa8/0xb8
    [<ffffffc0017952c0>] fimc_is_driver_init+0x18/0x24
    [<ffffffc000082ae4>] do_one_initcall+0xec/0x240
    [<ffffffc001755e50>] kernel_init_freeable+0x288/0x330
    [<ffffffc000eeab1c>] kernel_init+0xc/0xf0
    Memory state around the buggy address:
     ffffffc08d27fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
     ffffffc08d27ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    >ffffffc08d27ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                      ^
     ffffffc08d280000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     ffffffc08d280080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    ==================================================================

Change-Id: Id2794dfbb02c5fac923f0df15618609fe5387503
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agofimc-is: Set allow_zero_bytesused flag on videbuf2 queues
Marek Szyprowski [Wed, 12 Aug 2015 08:29:23 +0000 (10:29 +0200)]
fimc-is: Set allow_zero_bytesused flag on videbuf2 queues

Change-Id: Ib477ca52c34de66b22e7583696ebd2a250917677
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Get rid of struct v4l2_subdev_core_ops::init use
Sylwester Nawrocki [Thu, 30 Jul 2015 04:21:48 +0000 (13:21 +0900)]
fimc-is: Get rid of struct v4l2_subdev_core_ops::init use

The init() is too limited to be used in this driver, it is deprecated
and usage of this callback should be removed anyway.
There is no device nodes for subdevs so ioctl is no exposed to user space.

Change-Id: I7ff42e1a7843826cba8cb9e652616b8c10a8c932
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix/add vidioc_querycap for several video nodes
Sylwester Nawrocki [Thu, 30 Jul 2015 01:55:38 +0000 (10:55 +0900)]
fimc-is: Fix/add vidioc_querycap for several video nodes

This allows us to get rid of a warning from v4l2-core.

Change-Id: I30fae593f0dcdd314d5c2cd18f02528b78e7807c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fail device open when called from udev
Marek Szyprowski [Thu, 13 Aug 2015 12:52:20 +0000 (14:52 +0200)]
fimc-is: Fail device open when called from udev

This workaround avoids driver state change on system boot when udev checks
all video nodes.

Change-Id: I13f16b109251010f138f97943ab180c5003cf6b9
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Workaround to ensure proper video open sequence
Sylwester Nawrocki [Tue, 28 Jul 2015 05:06:58 +0000 (14:06 +0900)]
fimc-is: Workaround to ensure proper video open sequence

This a workaround to prevent system crash when video nodes are opened
in random sequence during system booting.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
fimc-is: hack video node open to require companion to be opened

Change-Id: I3b7f929c087acb32169fd6a26cee6eeb7e225497
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Add memory barriers in place of vb2_ion_sync_for_device() calls
Sylwester Nawrocki [Mon, 27 Jul 2015 01:17:35 +0000 (10:17 +0900)]
fimc-is: Add memory barriers in place of vb2_ion_sync_for_device() calls

Change-Id: If208bd4f9f7ef2b2c488b004d552891e57577e25
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Do not skip enabling enabled regulators
Marek Szyprowski [Thu, 6 Aug 2015 08:09:24 +0000 (10:09 +0200)]
fimc-is: Do not skip enabling enabled regulators

Regulators have proper on/off refcount, so use it instead of strange
is_enabled() based logic.

Change-Id: I6e23a5a6c3576d50581cb887f57a51897cdd86eb
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: temporary hack to ensure proper structure size
Marek Szyprowski [Thu, 23 Jul 2015 07:33:18 +0000 (09:33 +0200)]
fimc-is: temporary hack to ensure proper structure size

Change-Id: Ib87a85508a6be13ace45fcd800df867ad87115fc
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: temporary workaround for more strict vb2 buffer state tracking
Marek Szyprowski [Fri, 7 Aug 2015 08:42:08 +0000 (10:42 +0200)]
fimc-is: temporary workaround for more strict vb2 buffer state tracking

Change-Id: I72897d4cbf6cf0b6bd349fe5f99ebc45b8c461f9
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Correct error logs in fimc-is-groupmgr.c
Sylwester Nawrocki [Mon, 20 Jul 2015 01:53:30 +0000 (10:53 +0900)]
fimc-is: Correct error logs in fimc-is-groupmgr.c

Change-Id: I386a2b86fb6637617e02b9467020e196aaf31a15
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix printk format in wq_func_general() function
Sylwester Nawrocki [Mon, 20 Jul 2015 01:48:56 +0000 (10:48 +0900)]
fimc-is: Fix printk format in wq_func_general() function

Change-Id: Ia3ce3de8328ec5ab57b71bb383d274217a2a800a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove unneeded variable declarations
Sylwester Nawrocki [Mon, 20 Jul 2015 01:46:25 +0000 (10:46 +0900)]
fimc-is: Remove unneeded variable declarations

Change-Id: Ia5392e11cade65529a91fb5d000b879c55e66738
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use proper type for FIMC-LITE register region pointer
Sylwester Nawrocki [Fri, 17 Jul 2015 05:20:40 +0000 (14:20 +0900)]
fimc-is: Use proper type for FIMC-LITE register region pointer

Aside of dropping the pointless TO_WORD_OFFSET() macro this let's
us avoid errors on a 64-bit system where size of unsigned long is
8 bytes, as opposed to 4 bytes on 32-bit machines.

Change-Id: I572003d0f85a21724411030e322bf6da967a613a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix data type errors in debug printks
Sylwester Nawrocki [Fri, 17 Jul 2015 05:17:48 +0000 (14:17 +0900)]
fimc-is: Fix data type errors in debug printks

Change-Id: I7585c99ab7e8e2582da97e49688bea56ff66593f
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Remove unused function declarations from fimc-is-hw.h
Sylwester Nawrocki [Fri, 17 Jul 2015 05:15:33 +0000 (14:15 +0900)]
fimc-is: Remove unused function declarations from fimc-is-hw.h

Change-Id: If173cd69b6e4ac3431740fa1b787b8894a09e5d0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Use proper type for CSIS register region pointer
Sylwester Nawrocki [Fri, 17 Jul 2015 04:32:45 +0000 (13:32 +0900)]
fimc-is: Use proper type for CSIS register region pointer

Aside of dropping the pointless TO_WORD_OFFSET() macro this let's
us avoid errors on a 64-bit system where size of unsigned long is
8 bytes, as opposed to 4 bytes on 32-bit machines.

Change-Id: Ibba3165211b1d0a11ea34918cf8fc7033718420e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix CRC32 code for arm64
Marek Szyprowski [Thu, 16 Jul 2015 08:59:37 +0000 (10:59 +0200)]
fimc-is: Fix CRC32 code for arm64

Fix getCRC() function return type.

Change-Id: I4aab3b97d3ff2b35aaa5cef10ad06bc6301292f2
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Set correct paths to firmware files
Marek Szyprowski [Mon, 13 Jul 2015 10:43:39 +0000 (12:43 +0200)]
fimc-is: Set correct paths to firmware files

fimc-is-ois: correct sd card path
fimc-is: change firmware path to /lib/firmware to avoid confusion

Change-Id: I198cdc58c1464a963a8ca23875f7c9ae38175b13
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Use the same iommu address space for all fimc-is/sensors blocks
Marek Szyprowski [Wed, 5 Aug 2015 13:38:28 +0000 (15:38 +0200)]
fimc-is: Use the same iommu address space for all fimc-is/sensors blocks

Change-Id: Ib6cfb506e13d02f91489d45f3679effaa75ddfe8
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove ION integration code
Marek Szyprowski [Thu, 6 Aug 2015 07:43:41 +0000 (09:43 +0200)]
fimc-is: Remove ION integration code

Change-Id: I9b06e9479ee3028cce895f3f73b76d101c1572ac
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Add support for MIPI PHY power/reset control
Marek Szyprowski [Tue, 11 Aug 2015 08:28:56 +0000 (10:28 +0200)]
fimc-is: Add support for MIPI PHY power/reset control

Change-Id: Id7afb8b99a87a664a16f74ff0d3e6c28904cce1b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Fix all possible casting issues and function signature incompatibilities
Marek Szyprowski [Thu, 6 Aug 2015 10:59:20 +0000 (12:59 +0200)]
fimc-is: Fix all possible casting issues and function signature incompatibilities

Change-Id: Idd9371751954bb7b44d4c0a52f6e361e264e4b55
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Fix includes and make the code to compile on ARM64
Marek Szyprowski [Fri, 7 Aug 2015 08:41:03 +0000 (10:41 +0200)]
fimc-is: Fix includes and make the code to compile on ARM64

Change-Id: Ida4edf177272add32891af691661ee943cdac66a
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove pin_config_set() dependency
Marek Szyprowski [Fri, 10 Jul 2015 12:21:45 +0000 (14:21 +0200)]
fimc-is: Remove pin_config_set() dependency

Change-Id: I70ba0537ffaff4d2b3ad858d41aaa28622d9800d
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Add exynos_smc() implementation (temporary workaround)
Sylwester Nawrocki [Fri, 8 May 2015 14:35:05 +0000 (16:35 +0200)]
fimc-is: Add exynos_smc() implementation (temporary workaround)

Ported from arch/arm64/kernel/exynos-smc.S, include/linux/smc.h
from LSI kernel.

Change-Id: I94a82210ab1f4cfdeff12b87e51592f8d417a060
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agofimc-is: Disable support for V4L2_CID_IS_MAP_BUFFER
Marek Szyprowski [Thu, 9 Jul 2015 08:28:58 +0000 (10:28 +0200)]
fimc-is: Disable support for V4L2_CID_IS_MAP_BUFFER

Change-Id: I09c01ee11a4d359cf21535b7f00ddea7eb5e3015
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Configure clocks on companion open
Marek Szyprowski [Fri, 7 Aug 2015 08:17:23 +0000 (10:17 +0200)]
fimc-is: Configure clocks on companion open

Change-Id: I140e7793fcaeea81e756b22e03fb73047fca21df
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove conditional runtime PM support
Marek Szyprowski [Fri, 7 Aug 2015 06:37:00 +0000 (08:37 +0200)]
fimc-is: Remove conditional runtime PM support

Remove conditional runtime PM code.

Change-Id: Id8c12b806217bba6f242e926e4d88ef74a567289
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Replace hard coded PMU register access with regmap calls
Marek Szyprowski [Fri, 7 Aug 2015 08:36:26 +0000 (10:36 +0200)]
fimc-is: Replace hard coded PMU register access with regmap calls

Change-Id: Ifa9cccbbe68ff937c5ade1539592f5db0876edfb
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Read fimc-lite and csis regs and irqs from dt
Marek Szyprowski [Fri, 7 Aug 2015 08:36:35 +0000 (10:36 +0200)]
fimc-is: Read fimc-lite and csis regs and irqs from dt

Change-Id: I94a94d3e85c640cdec3f20289e97cb450e359252
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Remove unused code
Marek Szyprowski [Thu, 6 Aug 2015 13:21:55 +0000 (15:21 +0200)]
fimc-is: Remove unused code

 - remove unused sensor driver code
 - remove dead code for non-Exynos5433 SoCs
 - remove USE_OWN_FAULT_HANDLER support
 - remove ENABLE_CLOCK_GATE support
 - remove ENABLE_DVFS support
 - remove completely dead code
 - remove unused conditional code
 - remove pm qos support
 - remove ncp6335b support (unused)

Change-Id: Ibf4ca12f72642da12082f0d1bccd37b9eda04962
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Add code from arch/arm/mach-exynos and missing headers
Marek Szyprowski [Thu, 6 Aug 2015 13:24:20 +0000 (15:24 +0200)]
fimc-is: Add code from arch/arm/mach-exynos and missing headers

Change-Id: I15d16161f1d1f036bd4a0f359f40b94b4cf08e99
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agofimc-is: Initial import from SM-N910 Android LL release code
Marek Szyprowski [Thu, 6 Aug 2015 13:20:55 +0000 (15:20 +0200)]
fimc-is: Initial import from SM-N910 Android LL release code

Import fimc-is driver from SM-N910C_LL_Opensource (verified 32-bit
Android kernel) from opensource.samsung.com

Change-Id: I62eec9bc33a21c5742d2c5d5f79facfcb1ec59c9
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
5 years agospi: spi-s3c64xx: Add support for Exynos5433 ISP SPI controllers
Sylwester Nawrocki [Thu, 12 Apr 2018 15:02:00 +0000 (17:02 +0200)]
spi: spi-s3c64xx: Add support for Exynos5433 ISP SPI controllers

This patch adds support for the Exynos5433 ISP SPI devices. An additional
code performing the SPI controller's software reset is added to ensure
proper operation as the controller is also used by the FIMC-IS firmware.

Change-Id: I4c4e8d7b032e1068bb77411a5f19d8d3f17df3eb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Add DT property for byte swapping control
Sylwester Nawrocki [Thu, 12 Apr 2018 14:39:57 +0000 (16:39 +0200)]
spi: spi-s3c64xx: Add DT property for byte swapping control

Enabling this feature is required for the FIMC-IS subsystem driver.

Change-Id: I331f69eb5b41429449939ae5f05ee07a30f3405e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode
Sylwester Nawrocki [Thu, 12 Apr 2018 14:08:27 +0000 (16:08 +0200)]
spi: spi-s3c64xx: Allow higher transfer lengths in polling IO mode

Some variants of the SPI controller have no DMA support, in such case
SPI transfers longer than the FIFO length are not currently properly handled
by the driver. Fix it by doing multiple transfers in the s3c64xx_spi_transfer_one()
function if the SPI transfer length exceeds the FIFO size.

Change-Id: I6a21a72f40a52237ebe3c1f3037153e27f7392fb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Fix indentation in the register offset definitions
Sylwester Nawrocki [Thu, 12 Apr 2018 13:59:24 +0000 (15:59 +0200)]
spi: spi-s3c64xx: Fix indentation in the register offset definitions

Change-Id: I52f8ea378c45379ef36fa3753eec39a558a68f92
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode
Sylwester Nawrocki [Thu, 12 Apr 2018 13:57:17 +0000 (15:57 +0200)]
spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode

Currently timeout errors in polling I/O mode transfer are silently ignored.
Fix it by returning an error when we time out waiting on the RX FIFO level
to reach the transfer length.

Change-Id: I39d663204880bb5a9c4d092c020912055078416c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
5 years agospi: spi-s3c64xx: Drop unused enable_datapath() function argument
Sylwester Nawrocki [Thu, 12 Apr 2018 13:36:37 +0000 (15:36 +0200)]
spi: spi-s3c64xx: Drop unused enable_datapath() function argument

The spi pointer argument is not used now so remove it. While at it a s3c64xx_
prefix is added to the function name.

Change-Id: I2b7016af73834808268314cbcfbaec4b36558e22
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>