summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/davinci/isif.c
Commit message (Collapse)AuthorAgeFilesLines
* media: platform: rename davinci/ to ti/davinci/Mauro Carvalho Chehab2022-03-181-1128/+0
| | | | | | | | As the end goal is to have platform drivers split by vendor, rename davinci/ to ti/davinci/. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: isif: reset global stateEvgeny Novikov2020-11-161-2/+9
| | | | | | | | | | | | | isif_probe() invokes iounmap() on error handling paths, but it does not reset the global state. So, later it can invoke iounmap() even when ioremap() fails. This is the case also for isif_remove(). The patch resets the global state after invoking iounmap() to avoid this. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <novikov@ispras.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: isif: constify copied structureJulia Lawall2020-02-241-1/+1
| | | | | | | | | | | | The isif_config_defaults structure is only copied into another structure, so make it const. The opportunity for this change was found using Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* remove ioremap_nocache and devm_ioremap_nocacheChristoph Hellwig2020-01-061-1/+1
| | | | | | | | ioremap has provided non-cached semantics by default since the Linux 2.6 days, so remove the additional ioremap_nocache interface. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner2019-05-301-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* media: davinci-isif: avoid uninitialized variable useArnd Bergmann2019-03-291-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang warns about a possible variable use that gcc never complained about: drivers/media/platform/davinci/isif.c:982:32: error: variable 'frame_size' is uninitialized when used here [-Werror,-Wuninitialized] dm365_vpss_set_pg_frame_size(frame_size); ^~~~~~~~~~ drivers/media/platform/davinci/isif.c:887:2: note: variable 'frame_size' is declared here struct vpss_pg_frame_size frame_size; ^ 1 error generated. There is no initialization for this variable at all, and there has never been one in the mainline kernel, so we really should not put that stack data into an mmio register. On the other hand, I suspect that gcc checks the condition more closely and notices that the global isif_cfg.bayer.config_params.test_pat_gen flag is initialized to zero and never written to from any code path, so anything depending on it can be eliminated. To shut up the clang warning, just remove the dead code manually, it has probably never been used because any attempt to do so would have resulted in undefined behavior. Fixes: 63e3ab142fa3 ("V4L/DVB: V4L - vpfe capture - source for ISIF driver on DM365") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.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: isif: fix a NULL pointer dereference bugWenwen Wang2018-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | In isif_probe(), there is a while loop to get the ISIF base address and linearization table0 and table1 address. In the loop body, the function platform_get_resource() is called to get the resource. If platform_get_resource() returns NULL, the loop is terminated and the execution goes to 'fail_nobase_res'. Suppose the loop is terminated at the first iteration because platform_get_resource() returns NULL and the execution goes to 'fail_nobase_res'. Given that there is another while loop at 'fail_nobase_res' and i equals to 0, one iteration of the second while loop will be executed. However, the second while loop does not check the return value of platform_get_resource(). This can cause a NULL pointer dereference bug if the return value is a NULL pointer. This patch avoids the above issue by adding a check in the second while loop after the call to platform_get_resource(). Signed-off-by: Wenwen Wang <wang6495@umn.edu> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: isif: reorder a statement to match coding styleMauro Carvalho Chehab2018-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On all places, we do: void <asn_ref> *foo; Here, it is doing, instead: void * <asn_ref> foo; That tricks static analyzers, making it see errors where there's none. So, just reorder in order to cleanup those warnings: drivers/media/platform/davinci/isif.c:1066:22: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1066:22: expected void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1066:22: got void [noderef] <asn:2>* drivers/media/platform/davinci/isif.c:1074:44: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1074:44: expected void [noderef] <asn:2>*static [toplevel] [assigned] base_addr drivers/media/platform/davinci/isif.c:1074:44: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1078:51: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1078:51: expected void [noderef] <asn:2>*static [toplevel] [assigned] linear_tbl0_addr drivers/media/platform/davinci/isif.c:1078:51: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1082:51: warning: incorrect type in assignment (different address spaces) drivers/media/platform/davinci/isif.c:1082:51: expected void [noderef] <asn:2>*static [toplevel] [assigned] linear_tbl1_addr drivers/media/platform/davinci/isif.c:1082:51: got void *[noderef] <asn:2>addr drivers/media/platform/davinci/isif.c:1067:22: warning: dereference of noderef expression Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: davinci: allow building isif codeMauro Carvalho Chehab2018-04-171-2/+0
| | | | | | | | | | | The only reason why this driver doesn't build with COMPILE_TEST is because it includes mach/mux.h. It turns that none of the macros defined there are used. So, get rid of it, in order to allow it to build with COMPILE_TEST. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: davinci: make ccdc_hw_device structures constBhumika Goyal2017-10-311-1/+1
| | | | | | | | | | | | Make these structures const as they are only getting passed to the functions vpfe_{register/unregister}_ccdc_device having the argument as const. Structures found using Coccinelle and changes done by hand. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: Drop FSF's postal address from the source code filesSakari Ailus2017-01-271-4/+0
| | | | | | | | | | | | | | | | | | | | | Drop the FSF's postal address from the source code files that typically contain mostly the license text. Of the 628 removed instances, 578 are outdated. The patch has been created with the following command without manual edits: git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \ drivers/media/ include/media|while read i; do i=$i perl -e ' open(F,"< $ENV{i}"); $a=join("", <F>); $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m && $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m; close(F); open(F, "> $ENV{i}"); print F $a; close(F);'; done Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
* media: platform: davinci: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* [media] media: davinci: vpss: enable vpss clocksLad, Prabhakar2013-04-141-24/+4
| | | | | | | | | | | | | | | | | | | | | By default the VPSS clocks were enabled in capture driver for davinci family which creates duplicates for dm355/dm365/dm644x. This patch adds support to enable the VPSS clocks in VPSS driver, which avoids duplication of code and also adding clock aliases. This patch uses PM runtime API to enable/disable clock, instead of DaVinci clock framework. con_ids for master and slave clocks of vpss is added in pm_domain. This patch cleanups the VPSS clock enabling in the capture driver, and also removes the clock alias in machine file. Along side adds a vpss slave clock for DM365 as mentioned by Sekhar (https://patchwork.kernel.org/patch/1221261/). The Suspend/Resume in dm644x_ccdc.c which enabled/disabled the VPSS clock is now implemented as part of the VPSS driver. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] davinci: more gama -> gamma typo fixesHans Verkuil2013-03-191-1/+1
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Drivers: media: remove __dev* attributes.Greg Kroah-Hartman2013-01-031-2/+2
| | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* [media] media:davinci: clk - {prepare/unprepare} for common clkMurali Karicheri2012-11-211-1/+4
| | | | | | | | | | | | As a first step towards migrating davinci platforms to use common clock framework, replace all instances of clk_enable() with clk_prepare_enable() and clk_disable() with clk_disable_unprepare(). Also fixes some issues related to clk clean up in the driver Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com> Tested-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rename drivers/media/video as .../platformMauro Carvalho Chehab2012-08-151-0/+1162
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>