platform/kernel/linux-3.10.git
9 years agousb: s3c-hsotg: Use the new Exynos USB phy driver with the generic phy framework
Kamil Debski [Wed, 31 Jul 2013 10:04:33 +0000 (12:04 +0200)]
usb: s3c-hsotg: Use the new Exynos USB phy driver with the generic phy framework

Change the used phy driver to the new Exynos USB phy driver that uses the
generic phy framework.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: ehci-s5p: Change to use phy provided by the generic phy framework
Kamil Debski [Wed, 31 Jul 2013 08:43:00 +0000 (10:43 +0200)]
usb: ehci-s5p: Change to use phy provided by the generic phy framework

Change the phy provider used from the old usb phy specific to a new one
using the generic phy framework.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agophy: Add new Exynos USB PHY driver
Kamil Debski [Wed, 31 Jul 2013 08:35:15 +0000 (10:35 +0200)]
phy: Add new Exynos USB PHY driver

Add a new driver for the Exynos USB PHY. The new driver uses the generic
PHY framework.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoWIP: usb: gadget: add slp composite gadget
Chanho Park [Mon, 9 Sep 2013 10:14:06 +0000 (19:14 +0900)]
WIP: usb: gadget: add slp composite gadget

This patch only enables 'rndis' and 'sdb' function gadgets. We may need to
verify 'mtp', 'accessary' and so on. The slp gadget should be removed after
we migrate to configfs-based gadget configuration successfully.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agousb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr
Chanho Park [Mon, 9 Sep 2013 08:24:35 +0000 (17:24 +0900)]
usb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr

DWC2 databook indicates if the core sets "ErlySusp" bit, an idle state has been
detected on the USB for 3 ms. This situation can be occurred when waiting
a request from user daemon. So, we should keep the connection between udc and
gadget even though this interrupt is occurred.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoHACK: usb: gadget: Fix enumeration on boot
Chanho Park [Mon, 9 Sep 2013 08:23:54 +0000 (17:23 +0900)]
HACK: usb: gadget: Fix enumeration on boot

The Android gadget driver disconnects the gadget on bind
and expects the gadget to stay disconnected until it calls
usb_gadget_connect when userspace is ready. Removed the call
to usb_gadget_connect in usb_gadget_probe_driver to avoid
enabling the pullup before userspace is ready.

Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agotizen_defconfig update
Sylwester Nawrocki [Fri, 6 Sep 2013 13:22:30 +0000 (15:22 +0200)]
tizen_defconfig update

Enable s5p-jpeg, DRM FIMC and DRM image rotator drivers.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add common jpeg codec node for Exynos4 SoCs
Sylwester Nawrocki [Fri, 6 Sep 2013 10:20:31 +0000 (12:20 +0200)]
ARM: dts: Add common jpeg codec node for Exynos4 SoCs

Add common JPEG codec device node for Exynos4 SoCs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
9 years agoARM: dts: Add node aliases for ISP_I2C bus controllers
Sylwester Nawrocki [Thu, 5 Sep 2013 17:09:51 +0000 (19:09 +0200)]
ARM: dts: Add node aliases for ISP_I2C bus controllers

Ensure the ISP I2C bus adapters have always same id.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agovideo: exynos_dsi: Use generic PHY driver
Sylwester Nawrocki [Thu, 4 Apr 2013 12:13:51 +0000 (14:13 +0200)]
video: exynos_dsi: Use generic PHY driver

Use the generic PHY API instead of the platform callback to control
the MIPI DSIM DPHY.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v4:
 - updated to latest version of the PHY framework - removed PHY
   labels.

9 years ago[media] exynos4-is: Use the generic MIPI CSIS PHY driver
Sylwester Nawrocki [Thu, 4 Apr 2013 12:15:04 +0000 (14:15 +0200)]
[media] exynos4-is: Use the generic MIPI CSIS PHY driver

Use the generic PHY API instead of the platform callback to control
the MIPI CSIS DPHY. The 'phy_label' field is added to the platform
data structure to allow PHY lookup on non-dt platforms

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
Changes since v4:
 - updated to latest version of the PHY framework - removed PHY
   labels.

9 years agophy: Add driver for Exynos MIPI CSIS/DSIM DPHYs
Sylwester Nawrocki [Wed, 4 Sep 2013 13:07:24 +0000 (15:07 +0200)]
phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs

Add a PHY provider driver for the Samsung S5P/Exynos SoC MIPI CSI-2
receiver and MIPI DSI transmitter DPHYs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
---
Changes since v4:
 - updated to new version of devm_phy_create().

Changes since v3:
 - replaced spin_(un)lock_irq_{save,restore} with spin_{lock,unlock}.
 - DT binding file renamed to samsung-phy.txt, so it can be used for
   other PHYs as well,
 - removed <linux/delay.h> inclusion,
 - added missing spin_lock_init().

9 years agodrivers: phy: add generic PHY framework
Kishon Vijay Abraham I [Tue, 13 Aug 2013 11:19:01 +0000 (16:49 +0530)]
drivers: phy: add generic PHY framework

The PHY framework provides a set of APIs for the PHY drivers to
create/destroy a PHY and APIs for the PHY users to obtain a reference to the
PHY with or without using phandle. For dt-boot, the PHY drivers should
also register *PHY provider* with the framework.

PHY drivers should create the PHY by passing id and ops like init, exit,
power_on and power_off. This framework is also pm runtime enabled.

The documentation for the generic PHY framework is added in
Documentation/phy.txt and the documentation for dt binding can be found at
Documentation/devicetree/bindings/phy/phy-bindings.txt

Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "drivers: phy: add generic PHY framework"
Sylwester Nawrocki [Wed, 4 Sep 2013 09:40:06 +0000 (11:40 +0200)]
Revert "drivers: phy: add generic PHY framework"

This reverts commit 528bac1d1f2a8bb10ebc3e56dd8f22e2d76f197f.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs"
Sylwester Nawrocki [Wed, 4 Sep 2013 09:39:48 +0000 (11:39 +0200)]
Revert "phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs"

This reverts commit e1beba577ab67fe06d0d75546b28eea767bae03d.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "[media] exynos4-is: Use the generic MIPI CSIS PHY driver"
Sylwester Nawrocki [Wed, 4 Sep 2013 09:39:36 +0000 (11:39 +0200)]
Revert "[media] exynos4-is: Use the generic MIPI CSIS PHY driver"

This reverts commit 88d0875e5d8cb005a3c21dff52581b08b6fd22eb.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "video: exynos_dsi: Use generic PHY driver"
Sylwester Nawrocki [Wed, 4 Sep 2013 09:38:47 +0000 (11:38 +0200)]
Revert "video: exynos_dsi: Use generic PHY driver"

This reverts commit 304105d59b61ac6800a274cdcf8f618b5007456a.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agotizen_defconfig update
Sylwester Nawrocki [Wed, 4 Sep 2013 10:53:48 +0000 (12:53 +0200)]
tizen_defconfig update

Enable M0 front facing camera sensor driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoexynos4-is: Fix the writeback clocks handling
Andrzej Hajda [Fri, 30 Aug 2013 07:37:43 +0000 (09:37 +0200)]
exynos4-is: Fix the writeback clocks handling

The patch fixes situation when during probe clk_get() on some clock did
not succeed and the driver tries to clk_put() invalid clocks.
The fix prevents faults as follows:

[   43.785000] Unable to handle kernel NULL pointer dereference at virtual address 00000044
[   43.785000] pgd = e6214000
[   43.785000] [00000044] *pgd=00000000
[   43.785000] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[   43.785000] Modules linked in: s5p_fimc(+) ipv6 s5p_csis s5k5baf v4l2_mem2mem videobuf2_dma_contig videobuf2_memops exynos4_is_common videobuf2_core m5mols
[   43.785000] CPU: 0 PID: 2496 Comm: modprobe Not tainted 3.11.0-rc2-00316-ga8cf411 #1612
[   43.785000] task: e71a0000 ti: e6a08000 task.ti: e6a08000
[   43.785000] PC is at __clk_put+0x1c/0x8c
[   43.785000] LR is at clk_prepare_lock+0xc/0xd8
[   43.785000] pc : [<c02f0d5c>]    lr : [<c02f00f0>]    psr: 60000013
[   43.785000] sp : e6a09d20  ip : e6a09cd0  fp : c0d9df7c
[   43.785000] r10: e6698940  r9 : e71b4a00  r8 : c0d9eca0
[   43.785000] r7 : e71b5400  r6 : c0d9eacc  r5 : fffffdfb  r4 : 00000000
[   43.785000] r3 : e71a0000  r2 : 00000001  r1 : 00000947  r0 : 00000044
[   43.785000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   43.785000] Control: 10c5387d  Table: 6621404a  DAC: 00000015
[   43.785000] Process modprobe (pid: 2496, stack limit = 0xe6a08238)
[   43.785000] Stack: (0xe6a09d20 to 0xe6a0a000)
             ...
[   43.785000] [<c02f0d5c>] (__clk_put+0x1c/0x8c) from [<bf0992a0>] (fimc_md_put_clocks+0x48/0x6c [s5p_fimc])
[   43.785000] [<bf0992a0>] (fimc_md_put_clocks+0x48/0x6c [s5p_fimc]) from [<bf09a66c>] (fimc_md_probe+0x484/0x954 [s5p_fimc])
[   43.785000] [<bf09a66c>] (fimc_md_probe+0x484/0x954 [s5p_fimc]) from [<c0219c78>] (platform_drv_probe+0x18/0x1c)
[   43.785000] [<c0219c78>] (platform_drv_probe+0x18/0x1c) from [<c0218ab4>] (driver_probe_device+0x108/0x224)
[   43.785000] [<c0218ab4>] (driver_probe_device+0x108/0x224) from [<c0218c5c>] (__driver_attach+0x8c/0x90)
[   43.785000] [<c0218c5c>] (__driver_attach+0x8c/0x90) from [<c02171a8>] (bus_for_each_dev+0x54/0x88)
[   43.785000] [<c02171a8>] (bus_for_each_dev+0x54/0x88) from [<c02181c4>] (bus_add_driver+0xd4/0x22c)
[   43.785000] [<c02181c4>] (bus_add_driver+0xd4/0x22c) from [<c0219114>] (driver_register+0x78/0x14c)
[   43.785000] [<c0219114>] (driver_register+0x78/0x14c) from [<c00087a0>] (do_one_initcall+0xe4/0x140)
[   43.785000] [<c00087a0>] (do_one_initcall+0xe4/0x140) from [<c00672ac>] (load_module+0x17b4/0x1d4c)
[   43.785000] [<c00672ac>] (load_module+0x17b4/0x1d4c) from [<c006791c>] (SyS_init_module+0xd8/0xec)
[   43.785000] [<c006791c>] (SyS_init_module+0xd8/0xec) from [<c000e360>] (ret_fast_syscall+0x0/0x30)
[   43.785000] Code: 8a000012 ebfffce3 e2840044 f57ff05f (e1903f9f)

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agoARM: dts: exynos4210-trats: modify m5mols node according to driver
Andrzej Hajda [Tue, 3 Sep 2013 13:43:52 +0000 (15:43 +0200)]
ARM: dts: exynos4210-trats: modify m5mols node according to driver

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agoARM: dts: exynos4210-trats: change compatible for m5mols
Andrzej Hajda [Tue, 23 Jul 2013 14:35:20 +0000 (16:35 +0200)]
ARM: dts: exynos4210-trats: change compatible for m5mols

Changes manufacturer from samsung to fujitsu.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agom5mols: add async subdev registration
Andrzej Hajda [Wed, 4 Sep 2013 06:31:48 +0000 (08:31 +0200)]
m5mols: add async subdev registration

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agom5mols: add clock support
Andrzej Hajda [Tue, 3 Sep 2013 14:35:08 +0000 (16:35 +0200)]
m5mols: add clock support

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agom5mols: add device tree support
Andrzej Hajda [Tue, 3 Sep 2013 14:34:08 +0000 (16:34 +0200)]
m5mols: add device tree support

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years agom5mols: change module name to lowercase
Andrzej Hajda [Thu, 18 Jul 2013 09:32:22 +0000 (11:32 +0200)]
m5mols: change module name to lowercase

The change allows automatic load of the module
in case it is linked dynamically.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agos5k5baf: add camera sensor driver
Andrzej Hajda [Mon, 2 Sep 2013 14:42:15 +0000 (16:42 +0200)]
s5k5baf: add camera sensor driver

Driver for Samsung S5K5BAF UXGA 1/5" 2M CMOS Image Sensor
with embedded SoC ISP.
The driver exposes the sensor as two V4L2 subdevices:
- S5K5BAF-CIS - pure CMOS Image Sensor, fixed 1600x1200 format,
  no controls.
- S5K5BAF-ISP - Image Signal Processor, formats up to 1600x1200,
  pre/post ISP cropping, downscaling via selection API, controls.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Hi,

This is the 8th iteration of the patch.
I have applied suggestions from Laurent, Sylwester and Mark, thanks.
One exeception, I have left static struct v4l2_rect s5k5baf_cis_rect
not const due to fact its address is passed to function which could
modify its arguments, of course it never modifies s5k5baf_cis_rect.

Regards
Andrzej

v8
- improved description of data-lanes binding,
- added algorithm caching,
- added comments to functions,
- video bus type checking moved to probe,
- clk_get/put moved to probe,
- moved streaming checking under mutex,
- use proper functions for endian conversion,
- cosmetic changes

v7
- changed description of 'clock-frequency' DT property

v6
- endpoint node presence is now optional,
- added asynchronous subdev registration support and clock
  handling,
- use named gpios in DT bindings

v5
- removed hflip/vflip device tree properties

v4
- GPL changed to GPLv2,
- bitfields replaced by u8,
- cosmetic changes,
- corrected s_stream flow,
- gpio pins are no longer exported,
- added I2C addresses to subdev names,
- CIS subdev registration postponed after
  succesfull HW initialization,
- added enums for pads,
- selections are initialized only during probe,
- default resolution changed to 1600x1200,
- state->error pattern removed from few other functions,
- entity link creation moved to registered callback.

v3:
- narrowed state->error usage to i2c and power errors,
- private gain controls replaced by red/blue balance user controls,
- added checks to devicetree gpio node parsing

v2:
- lower-cased driver name,
- removed underscore from regulator names,
- removed platform data code,
- v4l controls grouped in anonymous structs,
- added s5k5baf_clear_error function,
- private controls definitions moved to uapi header file,
- added v4l2-controls.h reservation for private controls,
- corrected subdev registered/unregistered code,
- .log_status sudbev op set to v4l2 helper,
- moved entity link creation to probe routines,
- added cleanup on error to probe function.

9 years agoARM: dts: exynos4210-trats: update clocks and gpios in s5k5baf node
Andrzej Hajda [Tue, 3 Sep 2013 07:35:30 +0000 (09:35 +0200)]
ARM: dts: exynos4210-trats: update clocks and gpios in s5k5baf node

This patch updates s5k5baf node according to changes in bindings
of s5k5baf camera.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
9 years ago[media] m5mols: Convert to devm_request_irq()
Laurent Pinchart [Thu, 2 May 2013 11:29:43 +0000 (08:29 -0300)]
[media] m5mols: Convert to devm_request_irq()

Using the managed function the free_irq() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] media: i2c: Convert to devm_regulator_bulk_get()
Laurent Pinchart [Thu, 2 May 2013 11:29:43 +0000 (08:29 -0300)]
[media] media: i2c: Convert to devm_regulator_bulk_get()

Using the managed function the regulator_bulk_put() calls can be removed
from the probe error path and the remove handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] media: i2c: Convert to devm_gpio_request_one()
Laurent Pinchart [Thu, 2 May 2013 11:29:43 +0000 (08:29 -0300)]
[media] media: i2c: Convert to devm_gpio_request_one()

Using the managed function the gpio_free() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] media: i2c: Convert to devm_kzalloc()
Laurent Pinchart [Thu, 2 May 2013 11:29:43 +0000 (08:29 -0300)]
[media] media: i2c: Convert to devm_kzalloc()

Using the managed function the kfree() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] media: i2c: Convert to gpio_request_one()
Laurent Pinchart [Thu, 2 May 2013 14:11:50 +0000 (11:11 -0300)]
[media] media: i2c: Convert to gpio_request_one()

Replace gpio_request() with gpio_request_one() and remove the associated
gpio_direction_output() calls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoRevert "m5mols: device initialization moved to V4L2 registered callback"
Sylwester Nawrocki [Mon, 2 Sep 2013 14:33:02 +0000 (16:33 +0200)]
Revert "m5mols: device initialization moved to V4L2 registered callback"

This reverts commit 30e7664276434227e448742b49738b47d03b6090.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "m5mols: added device tree support"
Sylwester Nawrocki [Mon, 2 Sep 2013 14:32:48 +0000 (16:32 +0200)]
Revert "m5mols: added device tree support"

This reverts commit 12f6bb8f0dc0c8865ca85825596e02a03d907b57.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoRevert "s5k5baf: add camera sensor driver"
Sylwester Nawrocki [Mon, 2 Sep 2013 14:14:19 +0000 (16:14 +0200)]
Revert "s5k5baf: add camera sensor driver"

This reverts commit 80ca90cdf56ed7a375e31275fde4282e22f8edba.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoexynos4-is: Add support for asynchronous sensor subddevs registration
Sylwester Nawrocki [Fri, 9 Aug 2013 18:21:10 +0000 (20:21 +0200)]
exynos4-is: Add support for asynchronous sensor subddevs registration

Add support for registering external sensor subdevs using the v4l2-async
API. The async API is used only for sensor subdevs and only for platforms
instantiated from Device Tree.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---

Changes since v1:
 - register clock provider after registering FIMC devices so the clock
   can be actually used right after it is registered.

9 years agoexynos4-is: Use external s5k6a3 sensor driver
Sylwester Nawrocki [Fri, 19 Jul 2013 14:35:11 +0000 (16:35 +0200)]
exynos4-is: Use external s5k6a3 sensor driver

This patch removes the common fimc-is-sensor driver for image sensors
that are normally controlled by the FIMC-IS firmware. The FIMC-IS
driver now contains only a table of properties specific to each sensor.
The sensor properties required for the ISP's firmware are parsed from
device tree and retrieved from the internal table, which is selected
based on the compatible property of an image sensor.

To use the Exynos4x12 internal ISP the S5K6A3 sensor driver (drivers/
media/i2c/s5k6a3.c) is now required.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoexynos4-is: Add clock provider for the external clocks
Sylwester Nawrocki [Wed, 28 Aug 2013 15:45:53 +0000 (17:45 +0200)]
exynos4-is: Add clock provider for the external clocks

This patch adds clock provider to expose the sclk_cam0/1 clocks
for image sensor subdevs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v2:
- embed #clocks-property into 'camera' node rather than creating
  separate subnode for the clock provider, edited the binding's
  documentation.

9 years agoV4L: s5c73m3: Add device tree support
Andrzej Hajda [Fri, 12 Jul 2013 09:11:10 +0000 (11:11 +0200)]
V4L: s5c73m3: Add device tree support

This patch adds the V4L2 asynchronous subdev registration and
device tree support. Common clock API is used to control the
sensor master clock from within the subdev driver.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v1:
 - added missing ret assignment on clk_get failure,
 - fixed error paths in probe(),
 - changed clock name to cis_extclk as specified in the datasheet,
 - separate properties used for the XSHUTDOWN, STANDBY GPIOs,
 - multiple correctiond in the binding documentation (improved
   description of data-lanes and clock-frequency properties).

9 years agoARM: dts: Update s5c73m3 sensor gpio properties for exynos4412 boards
Sylwester Nawrocki [Mon, 2 Sep 2013 13:17:12 +0000 (15:17 +0200)]
ARM: dts: Update s5c73m3 sensor gpio properties for exynos4412 boards

For synchronization with the latest driver update for mainline.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add clock properties for camera sensors on exyno4412 boards
Sylwester Nawrocki [Mon, 2 Sep 2013 13:13:54 +0000 (15:13 +0200)]
ARM: dts: Add clock properties for camera sensors on exyno4412 boards

Add clock properties to the camera sensor device nodes so the sensor
drivers can get actual frequency of their master clock and control the
clock.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add #clock-cells property to camera node in exynos4.dtsi
Sylwester Nawrocki [Mon, 2 Sep 2013 13:05:57 +0000 (15:05 +0200)]
ARM: dts: Add #clock-cells property to camera node in exynos4.dtsi

Add #clock-cells property for the CAM_*_CLKOUT clocks provider
and label the camera node to allow referencing clocks at the
clock consumers.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add missing data-lanes property for exynos4412-* boards
Sylwester Nawrocki [Mon, 2 Sep 2013 12:18:31 +0000 (14:18 +0200)]
ARM: dts: Add missing data-lanes property for exynos4412-* boards

The updated driver requires data-lanes property.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years ago[media] s5c73m3: Convert to devm_gpio_request_one()
Laurent Pinchart [Thu, 2 May 2013 11:29:43 +0000 (08:29 -0300)]
[media] s5c73m3: Convert to devm_gpio_request_one()

Use the devm_gpio_request_one() managed function to simplify cleanup
code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoRevert "V4L: s5c73m3: Initial device tree support"
Sylwester Nawrocki [Mon, 2 Sep 2013 10:38:19 +0000 (12:38 +0200)]
Revert "V4L: s5c73m3: Initial device tree support"

This reverts commit 73cb9c6410de507d85aec8df3ffcaeb0742c6f00.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoV4L: s5k6a3: Add support for asynchronous subdev registration
Sylwester Nawrocki [Wed, 28 Aug 2013 11:41:03 +0000 (13:41 +0200)]
V4L: s5k6a3: Add support for asynchronous subdev registration

This patch converts the driver to use v4l2 asynchronous subdev
registration API an the clock API to control the external master
clock directly.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v2:
 - fixed error paths in probe().

9 years agoV4L: Add driver for s5k6a3 image sensor
Sylwester Nawrocki [Fri, 9 Aug 2013 18:56:00 +0000 (20:56 +0200)]
V4L: Add driver for s5k6a3 image sensor

This patch adds subdev driver for Samsung S5K6A3 raw image sensor.
As it is intended at the moment to be used only with the Exynos
FIMC-IS (camera ISP) subsystem it is a pretty minimal subdev driver.
It doesn't do any I2C communication since the sensor is controlled
by the ISP and its own firmware.
This driver can be updated in future, should anyone need it to be
a regular subdev driver where the main CPU communicates with the
sensor directly.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v1:
 - added missing pm_runtime_disable(),
 - removed subdev name overriding,
 - s/S5K6A3_DEF_PIX/S5K6A3_DEFAULT_

9 years agoV4L: s5k6a3: Add DT binding documentation
Sylwester Nawrocki [Tue, 27 Aug 2013 09:15:41 +0000 (11:15 +0200)]
V4L: s5k6a3: Add DT binding documentation

This patch adds binding documentation for the Samsung S5K6A3(YX)
raw image sensor.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---

The binding of this sensors shows some issue in the generic video-interfaces
binding. Namely The video bus type (serial MIPI CSI-2, parallel ITU-R BT.656,
etc.) is being determined by the binding parser (v4l2-of.c) depending on what
properties are found in an enddpoint node.

Please have a look at the data-lanes property description. The sensor supports
MIPI CSI-2 and SMIA CCP2 interfaces which both use one data lane. One data lane
is everything this sensors supports. During our discussions on the generic
bidings in the past I proposed to introduce a property in the endpoint node
that would indicate what bus type (standard/protocol) is used, e.g. MIPI CSI-2,
ITU-R BT.656, SMIA CCP2, etc. It was argued though that we can well determine
bus type based on properties found in the endpoint node.

So now in case of this sensor I'm not sure how it can be differentiated
whether MIPI CSI-2 or CCP2 bus is used. There is no CCP2 specific generic
properties yet. Anyway I'm not really happy there is no property like bus_type
that would clearly indicate what data bus type is used. Then would would for
instance not specify "data-lanes" in endpoint node just to differentiate
between MIPI CSI-2 and the parallel busses.

The main issue for this particular binding is that even with data-lanes = <1>;
it is still impossible to figure out whether MIPI CSI-2 or SMIA CCP2 data bus
is used.

So how about introducing, e.g. a string type "bus_type" common property ?
I'm considering starting a separate thread for discussing this.

9 years ago[media] s5c73m3: s5c73m3_spi_write() clean up
Lukasz Czerwinski [Mon, 26 Aug 2013 11:56:17 +0000 (13:56 +0200)]
[media] s5c73m3: s5c73m3_spi_write() clean up

This path removes unnecessary transfer at the end of s5c73m3_spi_write()
function.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years ago[media] s5c73m3: Change SPI write packet size
Lukasz Czerwinski [Mon, 26 Aug 2013 11:49:50 +0000 (13:49 +0200)]
[media] s5c73m3: Change SPI write packet size

This path changes s5c73m3_spi_write() packet size from 64 B
to 16 kB. Packet length bigger than the TX FIFO buffer enables
DMA mode for transfer.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: Remove unused code
Lukasz Czerwinski [Fri, 30 Aug 2013 11:50:30 +0000 (13:50 +0200)]
spi: spi-s3c64xx: Remove unused code

So far physical address (used to set dma transfer) was obtained
from mapping virtual address of the client buffer address passed
in SPI message. Deprecated code uses dma_map_single() and
dma_unmap_single().

Now mapping of virtual address has been replaced by data
transfer from client buffer to contiguous regions allocated by
dma_alloc_coherent(). Physical address of dma buffers is used
to set dma transfer.

This makes functions: s3c64xx_spi_map_mssg(), s3c64xx_spi_unmap()
redundant hence they are removed.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: s3c64xx_prepare_dma() clean up
Lukasz Czerwinski [Mon, 2 Sep 2013 16:23:29 +0000 (18:23 +0200)]
spi: spi-s3c64xx: s3c64xx_prepare_dma() clean up

One element scatterlist initizalization is replaced by the hardcoded
initization in the dmaengine_prep_slave_single() function.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: Add coherent buffers for dma transfers
Lukasz Czerwinski [Mon, 26 Aug 2013 12:20:44 +0000 (14:20 +0200)]
spi: spi-s3c64xx: Add coherent buffers for dma transfers

The spi-s3c64xx currently doesn't support transfers from non-contiguous
client buffers.

This patch adds two coherent buffers which allow transfers from
non-contiguous client buffers without extra coherent memory allocation
in the client driver.

Buffer size is hardcoded to 16kB for Tx/Rx. Client drivers shouldn't
exceed that value.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: Refactor dma sections
Lukasz Czerwinski [Mon, 26 Aug 2013 12:11:08 +0000 (14:11 +0200)]
spi: spi-s3c64xx: Refactor dma sections

This patch removes dma channel initialization and deinitialization for each
transfer. Now dma channel is requested only for the first spi transfer
and stored in driver data.

This solution optimizes execution time of the send_message loop because
driver doesn't request dma channel for each transfer anymore. It uses already
requested dma channel from s3c64xx_spi_dma_data struct.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: Correct functions namespacing
Lukasz Czerwinski [Wed, 21 Aug 2013 12:28:01 +0000 (14:28 +0200)]
spi: spi-s3c64xx: Correct functions namespacing

This path adds missing s3c64xx_ prefixes to functions in the driver.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agospi: spi-s3c64xx: Remove platform dependent code
Lukasz Czerwinski [Wed, 21 Aug 2013 11:13:00 +0000 (13:13 +0200)]
spi: spi-s3c64xx: Remove platform dependent code

This patch removes platform dependent code from the spi-s3c64xx driver.

Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agoARM: tizen_defconfig: disable s5p-ehci
Chanho Park [Tue, 3 Sep 2013 08:32:00 +0000 (17:32 +0900)]
ARM: tizen_defconfig: disable s5p-ehci

Until we resolve phy issue of otg(host/device), we disable the
ehci configuration.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agodma: pl330: use dma_addr_t for describing bus addresses
Will Deacon [Mon, 10 Jun 2013 18:34:38 +0000 (19:34 +0100)]
dma: pl330: use dma_addr_t for describing bus addresses

The microcode bus address (pl330_dmac.mcode_bus) is currently a u32,
which fails to compile when building on a system with 64-bit bus
addresses.

This patch uses dma_addr_t to represent the address instead.

Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agodma: pl330: rip out broken, redundant ID probing
Will Deacon [Mon, 10 Jun 2013 18:34:37 +0000 (19:34 +0100)]
dma: pl330: rip out broken, redundant ID probing

The PL330 driver probes the peripheral and primecell IDs of the device to
make sure that it is indeed an AMBA PL330. However, it does this by
making byte accesses to a device mapping of the word-aligned ID
registers, which is either UNPREDICTABLE or generates an alignment fault
(depending on the presence of the virtualisation extensions).

Rather than fix this code, we can actually rip most of it out and let
the AMBA bus driver correctly do the probing for us.

Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years ago[media] V4L: s5c73m3: Add format propagation for TRY formats
Andrzej Hajda [Wed, 24 Jul 2013 13:57:32 +0000 (10:57 -0300)]
[media] V4L: s5c73m3: Add format propagation for TRY formats

Resolution set on ISP pad of S5C73M3-OIF subdev should be
propagated to source pad for TRY and ACTIVE formats.
The patch adds missing propagation for TRY format.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Ensure the FIMC gate clock is disabled at driver remove()
Andrzej Hajda [Fri, 19 Jul 2013 10:39:53 +0000 (07:39 -0300)]
[media] exynos4-is: Ensure the FIMC gate clock is disabled at driver remove()

The patch fixes following warning:
[ 9664.460000] WARNING: CPU: 0 PID: 2880 at drivers/clk/clk.c:695 __clk_unprepare+0x8c/0xa4()
[ 9664.470000] Modules linked in: m5mols s5k5baf s5p_fimc(-) ipv6 s5p_csis v4l2_mem2mem videobuf2_dma_contig videobuf2_memops exynos4_is_common videobuf2_core [last unloaded: m5mols]
[ 9664.485000] CPU: 0 PID: 2880 Comm: rmmod Tainted: G        W    3.11.0-rc1-00070-ga94e22f-dirty #1558
[ 9664.495000] [<c0014aec>] (unwind_backtrace+0x0/0xf8) from [<c0011574>] (show_stack+0x10/0x14)
[ 9664.505000] [<c0011574>] (show_stack+0x10/0x14) from [<c038b248>] (dump_stack+0x6c/0xac)
[ 9664.510000] [<c038b248>] (dump_stack+0x6c/0xac) from [<c001d824>] (warn_slowpath_common+0x64/0x88)
[ 9664.520000] [<c001d824>] (warn_slowpath_common+0x64/0x88) from [<c001d864>] (warn_slowpath_null+0x1c/0x24)
[ 9664.530000] [<c001d864>] (warn_slowpath_null+0x1c/0x24) from [<c02f0b9c>] (__clk_unprepare+0x8c/0xa4)
[ 9664.540000] [<c02f0b9c>] (__clk_unprepare+0x8c/0xa4) from [<c02f0bc8>] (clk_unprepare+0x14/0x1c)
[ 9664.550000] [<c02f0bc8>] (clk_unprepare+0x14/0x1c) from [<bf191344>] (fimc_clk_put+0x3c/0x5c [s5p_fimc])
[ 9664.560000] [<bf191344>] (fimc_clk_put+0x3c/0x5c [s5p_fimc]) from [<bf1913c0>] (fimc_remove+0x5c/0x90 [s5p_fimc])
[ 9664.570000] [<bf1913c0>] (fimc_remove+0x5c/0x90 [s5p_fimc]) from [<c0219ca0>] (platform_drv_remove+0x18/0x1c)
[ 9664.580000] [<c0219ca0>] (platform_drv_remove+0x18/0x1c) from [<c021856c>] (__device_release_driver+0x70/0xcc)
[ 9664.590000] [<c021856c>] (__device_release_driver+0x70/0xcc) from [<c0218d54>] (driver_detach+0xac/0xb0)
[ 9664.595000] [<c0218d54>] (driver_detach+0xac/0xb0) from [<c021839c>] (bus_remove_driver+0x7c/0xc0)
[ 9664.605000] [<c021839c>] (bus_remove_driver+0x7c/0xc0) from [<c00659d8>] (SyS_delete_module+0x11c/0x204)
[ 9664.615000] [<c00659d8>] (SyS_delete_module+0x11c/0x204) from [<c000e360>] (ret_fast_syscall+0x0/0x30)
[ 9664.625000] ---[ end trace 662c092cce432c8d ]---

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Print error message on timeout
Dan Carpenter [Fri, 23 Aug 2013 08:36:56 +0000 (05:36 -0300)]
[media] exynos4-is: Print error message on timeout

There is a stray '!' character so the error message never gets printed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Annotate unused functions
Sachin Kamat [Fri, 2 Aug 2013 05:32:13 +0000 (02:32 -0300)]
[media] exynos4-is: Annotate unused functions

__is_set_init_isp_aa and fimc_is_hw_set_tune currently do not have
any callers. However these functions may be used in the future. Hence
instead of deleting them, staticize and annotate them with __maybe_unused
flag to avoid compiler warnings.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Simplify sclk_cam clocks handling
Sylwester Nawrocki [Fri, 19 Jul 2013 13:05:17 +0000 (10:05 -0300)]
[media] exynos4-is: Simplify sclk_cam clocks handling

Use clk_prepare_enable()/clk_disable_unprepare() instead of
separately prearing/unparing the clk_cam clocks. This simplifies
the code that is now mostly not going to be used, function
__fimc_md_set_camclk() is only left for S5PV210 platform which
is not yet converted to Device Tree.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Add missing v4l2_device_unregister() call in fimc_md_remove()
Sylwester Nawrocki [Fri, 9 Aug 2013 17:23:53 +0000 (14:23 -0300)]
[media] exynos4-is: Add missing v4l2_device_unregister() call in fimc_md_remove()

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Add missing MODULE_LICENSE for exynos-fimc-is.ko
Sylwester Nawrocki [Wed, 31 Jul 2013 14:08:19 +0000 (11:08 -0300)]
[media] exynos4-is: Add missing MODULE_LICENSE for exynos-fimc-is.ko

This fixes compilation warning:
WARNING: modpost: missing MODULE_LICENSE() in
drivers/media/platform/exynos4-is/exynos-fimc-is.o

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Initialize the ISP subdev sd->owner field
Sylwester Nawrocki [Mon, 5 Aug 2013 13:35:25 +0000 (10:35 -0300)]
[media] exynos4-is: Initialize the ISP subdev sd->owner field

Set the subdevs owner module so the exynos4_fimc_is module cannot
be unloaded when the FIMC-IS driver is in use.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] exynos4-is: Fix potential NULL pointer dereference
Sachin Kamat [Fri, 2 Aug 2013 07:58:25 +0000 (04:58 -0300)]
[media] exynos4-is: Fix potential NULL pointer dereference

dev->of_node could be NULL. Hence check for the same and return before
dereferencing it in the subsequent error message.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] media: OF: add "sync-on-green-active" property
Lad, Prabhakar [Sun, 11 Aug 2013 05:02:24 +0000 (02:02 -0300)]
[media] media: OF: add "sync-on-green-active" property

This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l2-async: Use proper list head for iteration over registered subdevs
Sylwester Nawrocki [Wed, 31 Jul 2013 16:10:18 +0000 (13:10 -0300)]
[media] v4l2-async: Use proper list head for iteration over registered subdevs

This fixes regression introduced in commit b426b3a660c85faf6e1ca1c92c6d
[media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: async: Make it safe to unregister unregistered notifier
Laurent Pinchart [Wed, 3 Jul 2013 10:49:06 +0000 (07:49 -0300)]
[media] v4l: async: Make it safe to unregister unregistered notifier

Calling v4l2_async_notifier_unregister() on a notifier that hasn't been
registered leads to a crash. To simplify drivers, make it safe to
unregister a notifier that has not been registered.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: of: Drop acquired reference to node when getting next endpoint
Laurent Pinchart [Wed, 3 Jul 2013 02:05:51 +0000 (23:05 -0300)]
[media] v4l: of: Drop acquired reference to node when getting next endpoint

The of_get_child_by_name() function takes a reference to the node it
returns. Make sure to drop it when looking for the ports node in
v4l2_of_get_next_endpoint().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] v4l: of: Use of_get_child_by_name()
Laurent Pinchart [Wed, 3 Jul 2013 02:04:25 +0000 (23:04 -0300)]
[media] v4l: of: Use of_get_child_by_name()

Replace a manual loop through child nodes with a call to
of_get_child_by_name().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev
Sylwester Nawrocki [Mon, 22 Jul 2013 11:01:33 +0000 (08:01 -0300)]
[media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev

By integrating the v4l2-async API internals a bit more with
the core overall the v4l2-async code becomes a bit simpler
and easier to follow.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L: Rename subdev field of struct v4l2_async_notifier
Sylwester Nawrocki [Fri, 19 Jul 2013 15:31:10 +0000 (12:31 -0300)]
[media] V4L: Rename subdev field of struct v4l2_async_notifier

This is a purely cosmetic change. Since the 'subdev' member
points to an array of subdevs make it more explicit by
renaming to the plural form.

Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type
Sylwester Nawrocki [Fri, 19 Jul 2013 15:21:29 +0000 (12:21 -0300)]
[media] V4L: Add V4L2_ASYNC_MATCH_OF subdev matching type

Add support for matching by device_node pointer. This allows
the notifier user to simply pass a list of device_node pointers
corresponding to sub-devices.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
Sylwester Nawrocki [Fri, 19 Jul 2013 15:14:46 +0000 (12:14 -0300)]
[media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*

enum v4l2_async_bus_type also selects a method subdevs are matched
in the notification handlers, rename it to v4l2_async_match_type
so V4L2_ASYNC_MATCH_OF entry can be further added for matching by
device tree node pointer.

Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L: Drop bus_type check in v4l2-async match functions
Sylwester Nawrocki [Fri, 19 Jul 2013 15:08:08 +0000 (12:08 -0300)]
[media] V4L: Drop bus_type check in v4l2-async match functions

These match_* functions are internal callbacks and are always
invoked only after checking asd->bus_type. So drop redundant
checks in match_i2c() and match_platform() functions.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years ago[media] V4L2: fix compilation if CONFIG_I2C is undefined
Guennadi Liakhovetski [Mon, 24 Jun 2013 08:13:51 +0000 (05:13 -0300)]
[media] V4L2: fix compilation if CONFIG_I2C is undefined

i2c_verify_client() is only available, if I2C is enabled. Fix v4l2-async.c
compilation if I2C is disabled.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] V4L2: support asynchronous subdevice registration
Guennadi Liakhovetski [Tue, 8 Jan 2013 10:06:31 +0000 (07:06 -0300)]
[media] V4L2: support asynchronous subdevice registration

Currently bridge device drivers register devices for all subdevices
synchronously, typically, during their probing. E.g. if an I2C CMOS sensor
is attached to a video bridge device, the bridge driver will create an I2C
device and wait for the respective I2C driver to probe. This makes linking
of devices straight forward, but this approach cannot be used with
intrinsically asynchronous and unordered device registration systems like
the Flattened Device Tree. To support such systems this patch adds an
asynchronous subdevice registration framework to V4L2. To use it respective
(e.g. I2C) subdevice drivers must register themselves with the framework.
A bridge driver on the other hand must register notification callbacks,
that will be called upon various related events.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] V4L2: add a device pointer to struct v4l2_subdev
Guennadi Liakhovetski [Mon, 10 Jun 2013 18:07:35 +0000 (15:07 -0300)]
[media] V4L2: add a device pointer to struct v4l2_subdev

It is often useful to have simple means to get from a subdevice to the
underlying physical device. This patch adds such a pointer to struct
v4l2_subdev and sets it accordingly in the I2C and SPI cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years ago[media] V4L2: add temporary clock helpers
Guennadi Liakhovetski [Tue, 4 Dec 2012 10:42:15 +0000 (07:42 -0300)]
[media] V4L2: add temporary clock helpers

Typical video devices like camera sensors require an external clock source.
Many such devices cannot even access their hardware registers without a
running clock. These clock sources should be controlled by their consumers.
This should be performed, using the generic clock framework. Unfortunately
so far only very few systems have been ported to that framework. This patch
adds a set of temporary helpers, mimicking the generic clock API, to V4L2.
Platforms, adopting the clock API, should switch to using it. Eventually
this temporary API should be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoclk: Implement clk_unregister
Sylwester Nawrocki [Tue, 6 Aug 2013 10:50:03 +0000 (12:50 +0200)]
clk: Implement clk_unregister

clk_unregister() is currently not implemented and it is required when
a clock provider module needs to be unloaded.

Normally the clock supplier module is prevented to be unloaded by
taking reference on the module in clk_get().

For cases when the clock supplier module deinitializes despite the
consumers of its clocks holding a reference on the module, e.g. when
the driver is unbound through "unbind" sysfs attribute, there are
empty clock ops added. These ops are assigned temporarily to struct
clk and used until all consumers release the clock, to avoid invoking
callbacks from the module which just got removed.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v6:
 - fixed handling of NULL clk in clk_unregister(), clk pointer checks
   done before taking prepare_lock, pr_err() replaced with WARN_ON_ONCE.

Changes since v5:
- ensure clk->kref is not referenced when the passed clk is NULL.

Changes since v4:
 - none.

Changes since v3:
 - Use WARN_ON_ONCE() rather than WARN_ON() in clk_nodrv_disable_unprepare()
   callback.

Changes since v2:
 - none.

Changes since RFC v1:
 - renamed clk_dummy_* to clk_nodrv_*.

Changes since v3 of the original patch [1]:
 - reparent all children to the orphan list instead of leaving
   the clock unregistered when it has child clocks,
 - removed unnecessary prerequisite checks in clk_debug_unregister(),
 - struct clk is now being freed only when the last clock consumer
   calls clk_put(),
 - empty clock ops are used after clk_unregister() has been called
   until all references to the clock are released and the clock
   object is freed.

[1] http://www.spinics.net/lists/arm-kernel/msg247548.html

9 years agoclk: Assign module owner of a clock being registered
Sylwester Nawrocki [Fri, 23 Aug 2013 11:04:33 +0000 (13:04 +0200)]
clk: Assign module owner of a clock being registered

Use dev->driver->owner as the owner module of a clock, it ensures
reference on the module is taken in the __clk_get(), __clk_put()
helpers.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v5:
 - none.

9 years agoclk: Add common __clk_get(), __clk_put() implementations
Sylwester Nawrocki [Fri, 30 Aug 2013 11:02:40 +0000 (13:02 +0200)]
clk: Add common __clk_get(), __clk_put() implementations

This patch adds common __clk_get(), __clk_put() clkdev helpers which
replace their platform specific counterparts when the common clock
API is enabled.

The owner module pointer field is added to struct clk so a reference
to the clock supplier module can be taken by the clock consumers.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes since v5:
 - none.

Changes since v4:
 - dropped unnecessary struct module forward declaration from
   clk-provider.h

Changes since v3:
 - dropped exporting of __clk_get(), __clk_put().

Changes since v2:
 - fixed handling of NULL clock pointers in __clk_get(), __clk_put();

9 years agoclkdev: Fix race condition in clock lookup from device tree
Sylwester Nawrocki [Fri, 9 Aug 2013 15:33:39 +0000 (17:33 +0200)]
clkdev: Fix race condition in clock lookup from device tree

There is currently a race condition in the device tree part of clk_get()
function, since the pointer returned from of_clk_get_by_name() may become
invalid before __clk_get() call. E.g. due to the clock provider driver
remove() callback being called in between of_clk_get_by_name() and
__clk_get().

Fix this by doing both the look up and __clk_get() operations with the
clock providers list mutex held. This ensures that the clock pointer
returned from __of_clk_get_from_provider() call and passed to __clk_get()
is valid, as long as the clock supplier module first removes its clock
provider instance and then does clk_unregister() on the corresponding
clocks.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
Changes since v2:
 - none.

Changes since v1:
 - include "clk.h".

9 years agoclk: Provide not locked variant of of_clk_get_from_provider()
Sylwester Nawrocki [Fri, 9 Aug 2013 18:38:10 +0000 (20:38 +0200)]
clk: Provide not locked variant of of_clk_get_from_provider()

Add helper functions for the of_clk_providers list locking and
an unlocked variant of of_clk_get_from_provider().
These functions are intended to be used in the clkdev to avoid
race condition in the device tree based clock look up in clk_get().

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
Changes since v3:
 - none.

Changes since v2:
 - fixed typo in clk.h.

Changes since v1:
 - moved the function declaractions to a local header.

9 years agousb/gadget: mass_storage: merge usb_f_mass_storage module with u_ms module
Andrzej Pietrasiewicz [Thu, 11 Jul 2013 11:24:00 +0000 (13:24 +0200)]
usb/gadget: mass_storage: merge usb_f_mass_storage module with u_ms module

u_ms.ko is needed only together with usb_f_mass_storage.ko. Merge them.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: f_mass_storage: remove compatibility layer
Andrzej Pietrasiewicz [Thu, 11 Jul 2013 11:20:53 +0000 (13:20 +0200)]
usb/gadget: f_mass_storage: remove compatibility layer

There are no more old interface users left. Remove it.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: multi: convert to new interface of f_mass_storage
Andrzej Pietrasiewicz [Tue, 30 Jul 2013 09:23:28 +0000 (11:23 +0200)]
usb/gadget: multi: convert to new interface of f_mass_storage

Convert the legacy multi gadget to the new interface of f_mass_storage,
so that later the compatibility layer in f_mass_storage can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: multi: convert to new interface of f_rndis
Andrzej Pietrasiewicz [Fri, 26 Jul 2013 09:15:55 +0000 (11:15 +0200)]
usb/gadget: multi: convert to new interface of f_rndis

Convert the legacy multi gadget to the new interface of f_rndis,
so that later the compatibility layer in f_rndis can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: multi: convert to new interface of f_ecm
Andrzej Pietrasiewicz [Fri, 26 Jul 2013 09:12:46 +0000 (11:12 +0200)]
usb/gadget: multi: convert to new interface of f_ecm

Convert the legacy multi gadget to the new interface of f_ecm,
so that later the compatibility layer in f_ecm can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: acm_ms: convert to new interface of f_mass_storage
Andrzej Pietrasiewicz [Tue, 30 Jul 2013 09:22:47 +0000 (11:22 +0200)]
usb/gadget: acm_ms: convert to new interface of f_mass_storage

Convert the legacy acm_ms gadget to use the new function interface
of f_mass_storage, so that later the compatibility layer in
f_mass_storage can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: f_mass_storage: add configfs support
Andrzej Pietrasiewicz [Fri, 19 Jul 2013 07:14:44 +0000 (09:14 +0200)]
usb/gadget: f_mass_storage: add configfs support

From this commit on f_mass_storage is available through configfs.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: storage_common: add methods to show/store 'cdrom' and 'removable'
Andrzej Pietrasiewicz [Wed, 3 Jul 2013 12:44:11 +0000 (14:44 +0200)]
usb/gadget: storage_common: add methods to show/store 'cdrom' and 'removable'

This will be required by configfs integration.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: storage_common: make attribute operations more generic
Andrzej Pietrasiewicz [Wed, 3 Jul 2013 12:43:07 +0000 (14:43 +0200)]
usb/gadget: storage_common: make attribute operations more generic

Show/store methods for sysfs attributes contain code which can be used
also by configfs. Make them abstract the source the lun and rw_semaphore
are taken from.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: mass_storage: convert to new interface of f_mass_storage
Andrzej Pietrasiewicz [Tue, 30 Jul 2013 08:24:55 +0000 (10:24 +0200)]
usb/gadget: mass_storage: convert to new interface of f_mass_storage

Convert old mass_storage gadget to use the new interface of f_mass_storage
so that later the compatibility layer in f_mass_storage can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: f_mass_storage: convert to new function interface with backward compatibility
Andrzej Pietrasiewicz [Wed, 3 Jul 2013 12:40:41 +0000 (14:40 +0200)]
usb/gadget: f_mass_storage: convert to new function interface with backward compatibility

Converting mass storage to the new function interface requires converting
the USB mass storage's function code and its users.
This patch converts the f_mass_storage.c to the new function interface.
The file is now compiled into a separate usb_f_mass_storage.ko module.
The old function interface is provided by means of a preprocessor conditional
directives. After all users are converted, the old interface can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: f_mass_storage: use fsg_common_run_thread in fsg_common_init
Andrzej Pietrasiewicz [Wed, 3 Jul 2013 12:39:20 +0000 (14:39 +0200)]
usb/gadget: f_mass_storage: use fsg_common_run_thread in fsg_common_init

fsg_common_init is a lengthy function. Now there are helper functions
which cover all parts of it. Use them.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb/gadget: f_mass_storage: use fsg_common_set_inquiry_string in fsg_common_init
Andrzej Pietrasiewicz [Wed, 3 Jul 2013 12:38:53 +0000 (14:38 +0200)]
usb/gadget: f_mass_storage: use fsg_common_set_inquiry_string in fsg_common_init

fsg_common_init is a lengthy function. Now there are helper functions
which cover all parts of it. Use them.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>