summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/platform
AgeCommit message (Collapse)Author
2017-10-31media: staging: atomisp: Remove Gmin dead code #1Andy Shevchenko
struct camera_af_platform_data and bound functions are not used anywhere. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Remove unused members of camera_sensor_platform_dataAndy Shevchenko
Remove unused members along with dead code. Mostly done with help of coccinelle. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Do not set GPIO twiceAndy Shevchenko
gpiod_get() configures GPIO line at the time of successful request. Thus, no need to do this explicitly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: cleanup out of memory messagesAishwarya Pant
Logging of explicit out of memory messages is redundant since memory allocation failures produce a backtrace. Done with the help of the following cocci script: @@ expression ex, ret; statement s; constant char[] c; constant err; identifier f, l; @@ ex = \(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ... when != ex if ( ( !ex | unlikely(!ex) ) ) - { - f(..., c, ...); ( return ex; | return; | return err; | goto l; ) - } else s Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-27media: staging: media: atomisp: Fix oops by unbalanced clk enable/disable callHans de Goede
The common-clk core expects clk consumers to always call enable/disable in a balanced manner. The atomisp driver does not call gmin_flisclk_ctrl() in a balanced manner, so add a clock_on bool and skip redundant calls. This fixes kernel oops like this one: [ 19.811613] gc0310_s_config S [ 19.811655] ------------[ cut here ]------------ [ 19.811664] WARNING: CPU: 1 PID: 720 at drivers/clk/clk.c:594 clk_core_disabl [ 19.811666] Modules linked in: tpm_crb(+) snd_soc_sst_atom_hifi2_platform tpm [ 19.811744] CPU: 1 PID: 720 Comm: systemd-udevd Tainted: G C OE 4.1 [ 19.811746] Hardware name: Insyde T701/T701, BIOS BYT70A.YNCHENG.WIN.007 08/2 [ 19.811749] task: ffff988df7ab2500 task.stack: ffffac1400474000 [ 19.811752] RIP: 0010:clk_core_disable+0xc0/0x130 ... [ 19.811775] Call Trace: [ 19.811783] clk_core_disable_lock+0x1f/0x30 [ 19.811788] clk_disable+0x1f/0x30 [ 19.811794] gmin_flisclk_ctrl+0x87/0xf0 [ 19.811801] 0xffffffffc0528512 [ 19.811805] 0xffffffffc05295e2 [ 19.811811] ? acpi_device_wakeup_disable+0x50/0x60 [ 19.811815] ? acpi_dev_pm_attach+0x8e/0xd0 [ 19.811818] ? 0xffffffffc05294d0 [ 19.811823] i2c_device_probe+0x1cd/0x280 [ 19.811828] driver_probe_device+0x2ff/0x450 Fixes: "staging: atomisp: use clock framework for camera clocks" Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-09-23media: staging: atomisp: use clock framework for camera clocksPierre-Louis Bossart
The Atom ISP driver initializes and configures PMC clocks which are already handled by the clock framework. Remove all legacy vlv2_platform_clock stuff and move to the clk API to avoid conflicts, e.g. with audio machine drivers enabling the MCLK for external codecs Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Tested-by: Carlo Caione <carlo@endlessm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Remove unneeded intel-mid.h inclusionAndy Shevchenko
In many files in the driver the intel-mid.h header inclusion is redundant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Remove dead code for MID (#4)Andy Shevchenko
Since we switched to upstream IOSF MBI API the custom code become not in use anymore. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Remove dead code for MID (#3)Andy Shevchenko
intel_mid_msgbus_*_raw*() are not used anywhere. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Remove dead code for MID (#2)Andy Shevchenko
intel_mid_soc_stepping() is not used anywhere. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Don't override D3 delay settings hereAndy Shevchenko
The d3_delay parameter is set by arch/x86/pci/intel_mid_pci.c and drivers/pci/quirks.c. No need to override that settings in unrelated driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: atomisp: Remove dead code for MID (#1)Andy Shevchenko
Remove dead code. If someone needs it the P-Unit semaphore is handled by I2C DesignWare driver (drivers/i2c/busses/i2c-designware-baytrail.c). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] staging: atomisp: Do not call dev_warn with a NULL deviceHans de Goede
Do not call dev_warn with a NULL device, this silence the following 2 warnings: [ 14.392194] (NULL device *): Failed to find gmin variable gmin_V2P8GPIO [ 14.392257] (NULL device *): Failed to find gmin variable gmin_V1P8GPIO We could switch to using pr_warn for dev == NULL instead, but as comments in the source indicate, the check for these 2 special gmin variables with a NULL device is a workaround for 2 specific evaluation boards, so completely silencing the missing warning for these actually is a good thing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] staging: atomisp: Fix calling efivar_entry_get() with unaligned ↵Hans de Goede
arguments efivar_entry_get has certain alignment requirements and the atomisp platform code was not honoring these, causing an oops by triggering the WARN_ON in arch/x86/platform/efi/efi_64.c: virt_to_phys_or_null_size(). This commit fixes this by using the members of the efivar struct embedded in the efivar_entry struct we kzalloc as arguments to efivar_entry_get(), which is how all the other callers of efivar_entry_get() do this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-05-19[media] atomisp: fix coding style warningsAvraham Shukron
Fix for warnings reported by checkpatch.pl: - Multiline comment style - Bare "unsigned" - Missing blank line after declarations - Un-needed braces around single-statement branch Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-05-19[media] atomisp: fixed coding style errorsAvraham Shukron
Fix for error (not warnings) reported by checkpatch.pl Specifically: - missing whitespace around "=" and after "," - indentation with spaces instead of tabs - lines starting with a whitespace This patch does not affect the compiled code in any way. Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-05-19[media] atomisp: drop unused qos variableValentin Vidic
Fixes a sparse warning: drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c:35:5: warning: symbol 'qos' was not declared. Should it be static? Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-05-19[media] atomisp: fixed sparse warningsAvraham Shukron
Added "static" storage class to 4 not-declared functions Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: media: atomisp: fix range checking on clk_numColin Ian King
The range checking on clk_num is incorrect; fix these so that invalid clk_num values are detected correctly. Detected by static analysis with by PVS-Studio Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging/media: make atomisp vlv2_plat_clock explicitly non-modularPaul Gortmaker
The Makefile / Kconfig currently controlling compilation of this code is: clock/Makefile:obj-$(CONFIG_INTEL_ATOMISP) += vlv2_plat_clock.o atomisp/Kconfig:menuconfig INTEL_ATOMISP atomisp/Kconfig: bool "Enable support to Intel MIPI camera drivers" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init was already not in use by this driver, the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alan Cox <alan@linux.intel.com> Cc: linux-media@vger.kernel.org Cc: devel@driverdev.osuosl.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Remove unnecessary blank lines.Varsha Rao
Remove multiple blank lines, which are not required. This patch fixes the following check patch issue: CHECK: Please don't use multiple blank lines Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Added spaces around arithmetic operators.Varsha Rao
Add spaces around arithmetic operators (/, +, -), to fix the checkpatch issue. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17staging: media: atomisp: add missing include in vlv2_plat_clock.cJérémy Lefaure
To use IO functions like writel, readl, ioremap_nocache and iounmap, linux/io.h should be included. Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: atomisp: silence an array overflow warningDan Carpenter
Static checkers complain that we should check if "i" is in bounds before we check if "var8[i]" is a NUL char. This bug is harmless but also easy to fix. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: atomisp: remove redundant check for client being nullColin Ian King
The previous statement checks if client is null, so the null check when assigning dev is redundant and can be removed. Detected by CoverityScan, CID#1416555 ("Logically Dead Code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-07staging: atomisp: fix include Makefile messGreg Kroah-Hartman
Using LINUXINCLUDE is a very old hack, and doesn't play well with building objects in a different directory than the kernel source is in. So fix up the include file references to be relative to make it obvious we are pulling in local include files, which need to get fixed up. Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging/atomisp: fix platform_no_drv_owner.cocci warningskbuild test robot
drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c:248:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging/atomisp: Add support for the Intel IPU v2Alan Cox
This patch adds support for the Intel IPU v2 as found on Android and IoT Baytrail-T and Baytrail-CR platforms (those with the IPU PCI mapped). You will also need the firmware files from your device (Android usually puts them into /etc) - or you can find them in the downloadable restore/upgrade kits if you blew them away for some reason. It may be possible to extend the driver to handle the BYT/T windows platforms such as the ASUS T100TA. These platforms don't expose the IPU via the PCI interface but via ACPI buried in the GPU description and with the camera information somewhere unknown so would need a platform driver interface adding to the codebase *IFF* the firmware works on such devices. To get good results you also need a suitable support library such as libxcam. The camera is intended to be driven from Android so it has a lot of features that many desktop apps don't fully spport. In theory all the pieces are there to build it with -DISP2401 and some differing files to get CherryTrail/T support, but unifying the drivers properlly is a work in progress. The IPU driver represents the work of a lot of people within Intel over many years. It's historical goal was portability rather than Linux upstream. Any queries about the upstream aimed driver should be sent to me not to the original authors. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>