summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/marvell-ccic/mmp-driver.c
Commit message (Collapse)AuthorAgeFilesLines
* media: marvell-ccic: mmp: don't chicken out w/o pdataLubomir Rintel2019-06-241-3/+0Star
| | | | | | | | | It's impossible for mmpcam_calc_dphy() to be called without it. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic: provide a clock for the sensorLubomir Rintel2019-06-241-136/+16Star
| | | | | | | | | | | | | | | | | | | | | | The sensor needs the MCLK clock running when it's being probed. On platforms where the sensor is instantiated from a DT (MMP2) it is going to happen asynchronously. Therefore, the current modus operandi, where the bridge driver fiddles with the sensor power and clock itself is not going to fly. As the comments wisely note, this doesn't even belong there. Luckily, the ov7670 driver is already able to control its power and reset lines, we can just drop the MMP platform glue altogether. It also requests the clock via the standard clock subsystem. Good -- let's set up a clock instance so that the sensor can ask us to enable the clock. Note that this is pretty dumb at the moment: the clock is hardwired to a particular frequency and parent. It was always the case. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic: use async notifier to get the sensorLubomir Rintel2019-06-241-11/+16
| | | | | | | | | | | | | An instance of a sensor on DT-based MMP2 platform is always going to be created asynchronously. Let's move the manual device creation away from the core to the Cafe driver (used on OLPC XO-1, not present in DT) and set up appropriate async matches: I2C on Cafe, FWNODE on MMP (OLPC XO-1.75). Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic/mmp: add devicetree supportLubomir Rintel2019-06-241-9/+27
| | | | | | | | | | The platform data is actually not used anywhere (along with the CSI support) and should be safe to remove. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic: rename the clocksLubomir Rintel2019-06-241-1/+1
| | | | | | | | | | | Use the names more suitable for devicetree bindings. There are no board files utilizing this, thus we seem to be at liberty at renaming this without consequences. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic/mmp: enable clock before accessing registersLubomir Rintel2019-06-241-2/+1Star
| | | | | | | | | | The access to REG_CLKCTRL or REG_CTRL1 without the clock enabled hangs the machine. Enable the clock first. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: marvell-ccic: drop unused stuffLubomir Rintel2019-06-241-2/+0Star
| | | | | | | | | | Remove structure members and headers that are not actually used. Saves us from some noise in subsequent cleanup commits. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: Revert "[media] marvell-ccic: reset ccic phy when stop streaming for ↵Lubomir Rintel2019-06-241-25/+0Star
| | | | | | | | | | | | | | | | stability" This accesses the clock registers directly and thus is going to stay in the way of making the driver devicetree friendly. No boards seems to actually use this. If it's somehow actually needed it needs to be done differently. This reverts commit 7c269f454e7a51b151d94f99344120efa1cd0acb. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 172Thomas Gleixner2019-05-301-3/+1Star
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this file may be distributed under the terms of the gnu general public license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 9 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.395589349@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* media: platform: fix several typosMauro Carvalho Chehab2019-03-011-2/+2
| | | | | | | | | | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Houlong Wei <houlong.wei@mediatek.com> Reviewed-by: Yong Deng <yong.deng@magewell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l: mediabus: Recognise CSI-2 D-PHY and C-PHYSakari Ailus2018-10-041-1/+1
| | | | | | | | | | The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media bus enum. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab2018-09-111-1/+1
| | | | | | | | | | | The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Merge branch 'i2c/for-4.18' of ↵Linus Torvalds2018-06-141-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...) - conversion to use the i2c_8bit_addr_from_msg macro consistently - move includes to platform_data - core updates to allow the (still in review) I3C subsystem to connect - and the regular share of smaller driver updates * 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits) i2c: qup: fix building without CONFIG_ACPI i2c: tegra: Remove suspend-resume i2c: imx-lpi2c: Switch to SPDX identifier i2c: mxs: Switch to SPDX identifier i2c: busses: make use of i2c_8bit_addr_from_msg i2c: algos: make use of i2c_8bit_addr_from_msg i2c: rcar: document R8A77980 bindings i2c: qup: Add command-line parameter to override SCL frequency i2c: qup: Correct duty cycle for FM and FM+ i2c: qup: Add support for Fast Mode Plus i2c: qup: add probe path for Centriq ACPI devices i2c: robotfuzz-osif: drop pointless test i2c: robotfuzz-osif: remove pointless local variable i2c: rk3x: Don't print visible virtual mapping MMIO address i2c: opal: don't check number of messages in the driver i2c: ibm_iic: don't check number of messages in the driver i2c: imx: Switch to SPDX identifier i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data i2c: mux: demux-pinctrl: use proper parent device for demux adapter i2c: mux: improve error message for failed symlink ...
| * i2c: gpio: move header to platform_dataWolfram Sang2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This header only contains platform_data. Move it to the proper directory. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: James Hogan <jhogan@kernel.org> Acked-by: Greg Ungerer <gerg@uclinux.org>
* | media: mmp-driver: add needed __iomem marks to power_regsMauro Carvalho Chehab2018-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solve those warnings: drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:135:41: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:136:44: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:174:38: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:175:38: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: warning: incorrect type in argument 1 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:195:48: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:196:55: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:197:54: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: warning: incorrect type in argument 1 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:202:48: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:203:55: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: warning: incorrect type in argument 2 (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: expected void [noderef] <asn:2>*<noident> drivers/media/platform/marvell-ccic/mmp-driver.c:204:54: got void * drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: warning: incorrect type in assignment (different address spaces) drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: expected void *power_regs drivers/media/platform/marvell-ccic/mmp-driver.c:389:25: got void [noderef] <asn:2>* Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: mmp-driver: make two functions staticMauro Carvalho Chehab2018-04-171-2/+2
|/ | | | | | | | | | | | | | Those functions are used only internally: CC drivers/media/platform/marvell-ccic/mmp-driver.o drivers/media/platform/marvell-ccic/mmp-driver.c:186:6: warning: no previous prototype for ‘mcam_ctlr_reset’ [-Wmissing-prototypes] void mcam_ctlr_reset(struct mcam_camera *mcam) ^~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:217:6: warning: no previous prototype for ‘mmpcam_calc_dphy’ [-Wmissing-prototypes] void mmpcam_calc_dphy(struct mcam_camera *mcam) ^~~~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] include/media: move platform_data to linux/platform_data/mediaMauro Carvalho Chehab2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's not mix platform_data headers with the core headers. Instead, let's create a subdir at linux/platform_data and move the headers to that common place, adding it to MAINTAINERS. The headers were moved with: mkdir include/linux/platform_data/media/; git mv include/media/gpio-ir-recv.h include/media/ir-rx51.h include/media/mmp-camera.h include/media/omap1_camera.h include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h include/media/soc_camera_platform.h include/media/timb_radio.h include/media/timb_video.h include/linux/platform_data/media/ And the references fixed with this script: MAIN_DIR="linux/platform_data/" PREV_DIR="media/" DIRS="media/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
* [media] marvell-ccic: fill in bus_infoHans Verkuil2015-05-011-0/+1
| | | | | | | | | The bus_info field of struct v4l2_querycap wasn't filled in and v4l2-compliance complained about that. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: platform: marvell-ccic: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0Star
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* [media] media: marvell-ccic: use devm to release clkLibin Yang2013-12-091-31/+8Star
| | | | | | | | | | | | This patch uses devm to release the clks instead of releasing manually. And it adds enable/disable mipi_clk when getting its rate. Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: drop resource free in driver removeLibin Yang2013-11-291-7/+0Star
| | | | | | | | | | | The mmp-driver is using devm_* to allocate the resource. The old resource release methods are not appropriate here. Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: stable@vger.kernel.org # for v3.12 and up Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: drop free_irq for devm_request_irq allocated irqWei Yongjun2013-10-171-1/+0Star
| | | | | | | | | | irq allocated with devm_request_irq should not be freed using free_irq, because doing so causes a dangling pointer, and a subsequent double free. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resourceJulia Lawall2013-08-221-8/+0Star
| | | | | | | | | | | | | | | | | | | | | | | Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: switch to resource managed allocation and requestLibin Yang2013-07-261-38/+22Star
| | | | | | | | | | | This patch switchs to resource managed allocation and request in mmp-driver. It can remove free resource operations. Signed-off-by: Albert Wang <twang13@marvell.com> Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: reset ccic phy when stop streaming for stabilityLibin Yang2013-07-261-0/+25
| | | | | | | | | | | | | | This patch adds the reset ccic phy operation when stop streaming. Stop streaming without reset ccic phy, the next start streaming may be unstable. Also need add CCIC2 definition when PXA688/PXA2128 support dual ccics. Signed-off-by: Albert Wang <twang13@marvell.com> Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: add clock tree support for marvell-ccic driverLibin Yang2013-07-261-0/+61
| | | | | | | | | | This patch adds the clock tree support for marvell-ccic. Signed-off-by: Libin Yang <lbyang@marvell.com> Signed-off-by: Albert Wang <twang13@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: add MIPI support for marvell-ccic driverLibin Yang2013-07-261-5/+131
| | | | | | | | | | | This patch adds the MIPI support for marvell-ccic. Board driver should determine whether using MIPI or not. Signed-off-by: Albert Wang <twang13@marvell.com> Signed-off-by: Libin Yang <lbyang@marvell.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] marvell-ccic: check register addressHans Verkuil2013-06-171-0/+1
| | | | | | | | Prevent out-of-range register accesses. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-ccic: remove g_chip_identHans Verkuil2013-06-171-2/+1Star
| | | | | | | | | | Remove g_chip_ident. This driver used some of the V4L2_IDENT defines, replace those with a driver-specific enum. This makes it possible to drop the v4l2-chip-ident.h define as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rename drivers/media/video as .../platformMauro Carvalho Chehab2012-08-151-0/+380
The remaining drivers are mostly platform drivers. Name the dir to reflect it. It makes sense to latter break it into a few other dirs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>