summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci
Commit message (Collapse)AuthorAgeFilesLines
* media: atomisp: get rid of storage_class.hMauro Carvalho Chehab2017-11-0160-314/+230Star
| | | | | | | Don't hide function declaration on ugly macros. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: atomisp: get rid of wrong stddef.h includeMauro Carvalho Chehab2017-11-013-45/+3Star
| | | | | | | | | | | | | The places at atomisp.h that use stddef.h are wrong: the types it needs are actually defined at linux/types.h. Also, it causes lots of smatch warnings due to the redefinition of ofsetof() macro: /opt/gcc-7.1.0/x86/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include/stddef.h:417:9: warning: preprocessor token offsetof redefined ./include/linux/stddef.h:16:9: this was the original definition Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: atomisp: fix other inconsistent identingMauro Carvalho Chehab2017-11-015-36/+36
| | | | | | | | | | | | | | As reported by smatch: drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c:607 pipeline_stage_create() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:255 ov2680_write_reg_array() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:401 __ov2680_set_exposure() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4269 sh_css_params_write_to_ddr_internal() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:1008 atomisp_register_entities() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c:1709 ia_css_binary_find() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: atomisp: fix switch coding style at input_system.cMauro Carvalho Chehab2017-11-011-16/+16
| | | | | | | | | | | | | | Fix a switch at input_system.c that were causing smatch warnings: drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:610 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:616 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:622 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:610 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:616 rx_channel_get_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:622 rx_channel_get_state() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: atomisp: fix spatch warnings at sh_css.cMauro Carvalho Chehab2017-11-011-45/+46
| | | | | | | | | | | | | | | drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:5801:1: error: directive in argument list drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:5803:1: error: directive in argument list drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:3795 create_host_acc_pipeline() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:4343 ia_css_pipe_enqueue_buffer() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:6029 sh_css_pipe_configure_viewfinder() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:8693 ia_css_stream_capture() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:9781 ia_css_stream_create() warn: if statement not indented drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:9988 ia_css_stream_load() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:10525 ia_css_update_continuous_frames() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: atomisp: fix ident for assert/returnMauro Carvalho Chehab2017-11-0118-150/+150
| | | | | | | | | | | | | | On lots of places, assert/return are starting at the first column, causing indentation issues, as complained by spatch: drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/irq_private.h:32 irq_reg_store() warn: inconsistent indenting Used this small script to fix such occurrences: for i in $(git grep -l -E "^(assert|return)" drivers/staging/media/); do perl -ne 's/^(assert|return)\b/\t$1/; print $_' <$i >a && mv a $i; done Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
* media: staging: atomisp: Remove FSF snail addressAndy Shevchenko2017-10-3151-204/+0Star
| | | | | | | | | | | | | | | Snail address is subject to change, remove it completely from the code. This has been done using the following script: sed -i '/You should/,/02110-1301/d' \ $(git grep -n -w Franklin -- drivers/staging/media/atomisp/ | cut -f1 -d:) No functional change intended. 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>
* media: staging: atomisp: Remove unused members of camera_sensor_platform_dataAndy Shevchenko2017-10-311-8/+1Star
| | | | | | | | | | 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>
* media: staging: atomisp: Convert timers to use timer_setup()Kees Cook2017-10-314-25/+11Star
| | | | | | | | | | | | | | | | | In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alan Cox <alan@linux.intel.com> Cc: Daeseok Youn <daeseok.youn@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: devel@driverdev.osuosl.org Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: cleanup out of memory messagesAishwarya Pant2017-10-317-33/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* media: Staging: media: atomisp: pci: Eliminate use of typedefs for structSrishti Sharma2017-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of typedefs for struct is discouraged, and hence can be eliminated. Done using the following semantic patch by coccinelle. @r1@ type T; @@ typedef struct {...} T; @script: python p@ T << r1.T; T1; @@ if T[-2:] == "_t" or T[-2:] == "_T": coccinelle.T1 = T[:-2] else: coccinelle.T1 = T print T, T1 @r2@ type r1.T; identifier p.T1; @@ - typedef struct + T1 { ... } - T Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp2: cleanup null check on memory allocationAishwarya Pant2017-10-273-23/+22Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For memory allocation functions that fail with a NULL return value, it is preferred to use the (!x) test in place of (x == NULL). Changes in atomisp2/css2400/sh_css.c were done by hand. Done with the help of the following cocci script: @@ type T; T* p; statement s,s1; @@ p = \(devm_kzalloc\|devm_ioremap\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\| kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ...when != p if ( - p == NULL + !p ) s else s1 -- Changes in v3: Rebase changes over atomisp-next branch of the media tree Changes in atomisp2/css2400/sh_css.c were done by hand, the above script was not able to match the pattern if (a->b != null). Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: staging: atomisp: use ARRAY_SIZEJérémy Lefaure2017-10-271-6/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | Using the ARRAY_SIZE macro improves the readability of the code. Also, it is useless to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: staging/atomisp: make six local functions static to appease sparseMuhammad Falak R Wani2017-10-271-7/+7
| | | | | | | | | | | | | | | | | | | | The functions __bo_alloc, __bo_search_and_remove_from_free_rbtree, __bo_search_by_addr, __bo_search_by_addr_in_range, __bo_break_up and __bo_merge are local to the source and do not need to be in the global scope, so make them static. Cleans up sparse warnings: warning: symbol '__bo_alloc' was not declared. Should it be static? warning: symbol '__bo_search_and_remove_from_free_rbtree' was not declared. Should it be static? warning: symbol '__bo_search_by_addr' was not declared. Should it be static? warning: symbol '__bo_search_by_addr_in_range' was not declared. Should it be static? warning: symbol '__bo_break_up' was not declared. Should it be static? warning: symbol '__bo_merge' was not declared. Should it be static? Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: Staging: media: atomisp: Use kcalloc instead of kzallocSrishti Sharma2017-09-231-1/+3
| | | | | | | | | | | | Use kcalloc instead of kzalloc to check for an overflow before multiplication. Done using the following semantic patch by coccinelle. http://coccinelle.lip6.fr/rules/kzalloc.cocci Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: atomisp:use ARRAY_SIZE() instead of open codingAllen Pais2017-09-231-4/+2Star
| | | | | | | | | The array_length() macro just duplicates ARRAY_SIZE(), so we can delete it. Signed-off-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Staging: media: atomisp: Merge assignment with returnSrishti Sharma2017-09-231-5/+1Star
| | | | | | | | | | | | | | | | | | | | Merge the assignment and the return statements to return the value directly. Done using the following semantic patch by coccinelle. @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Staging: atomisp: fix alloc_cast.cocci warningsBranislav Radocaj2017-09-231-1/+1
| | | | | | | | | | | | | | | | | | Remove casting the values returned by memory allocation functions like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc. Semantic patch information: This makes an effort to find cases of casting of values returned by kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc, kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes the casting as it is not required. The result in the patch case may need some reformatting. Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci Signed-off-by: Branislav Radocaj <branislav@radocaj.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging/atomisp: Use ARRAY_SIZE macroThomas Meyer2017-09-231-1/+2
| | | | | | | | | | | | Use ARRAY_SIZE macro, rather than explicitly coding some variant of it yourself. Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\) /ARRAY_SIZE(\1)/g' and manual check/verification. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging/atomisp: fix header guardsNicolas Iooss2017-09-233-3/+3
| | | | | | | | | | | | | | | | | | | | Files input_formatter_subsystem_defs.h begin with: #ifndef _if_subsystem_defs_h #define _if_subsystem_defs_h__ and end with: #endif /* _if_subsystem_defs_h__ */ The intent seems to have been to use _if_subsystem_defs_h__ everywhere but two underscores are missing in the initial #ifndef. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: Remove unneeded intel-mid.h inclusionAndy Shevchenko2017-09-235-6/+0Star
| | | | | | | | 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>
* media: staging: atomisp: Remove dead code for MID (#4)Andy Shevchenko2017-09-231-1/+0Star
| | | | | | | | | 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>
* media: staging: atomisp: Move to upstream IOSF MBI APIAndy Shevchenko2017-09-233-30/+29Star
| | | | | | | | There is a common for x86 IOSF MBI API. Move atomisp code to use it. 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>
* media: atomisp: fix small Kconfig issuesHans Verkuil2017-09-231-8/+8
| | | | | | | | | | | | | The help text should be indented by at least two spaces after the 'help' separator. This is both good practice and the media_build system for building media drivers makes this assumption. Fix this for the atomisp/i2c/Kconfig and fix the atomisp/pci/Kconfig that didn't align the help separator with the preceding keywords. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Staging: atomisp: constify driver_attributeArvind Yadav2017-09-231-1/+1
| | | | | | | | | | driver_attribute are not supposed to change at runtime. Functions driver_create_file/driver_remove_file are working with const driver_attribute. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: atomisp2: Remove null check before kfreeHimanshu Jha2017-09-231-4/+2Star
| | | | | | | | Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: sh_css_calloc shall return a pointer to the ↵Sergei A. Trusov2017-09-051-0/+1
| | | | | | | | | | | | allocated space The calloc function returns either a null pointer or a pointer to the allocated space. Add the second case that is missed. Fixes: da22013f7df4 ("atomisp: remove indirection from sh_css_malloc") Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: media: atomisp: constify videobuf_queue_ops structuresJulia Lawall2017-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These videobuf_queue_ops structures are only passed as the second argument to videobuf_queue_vmalloc_init, which is declared as const. Thus the videobuf_queue_ops structures themselves can be const. Done with the help of Coccinelle. // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct videobuf_queue_ops i@p = { ... }; @ok1@ identifier r.i; expression e1; position p; @@ videobuf_queue_vmalloc_init(e1,&i@p,...) @bad@ position p != {r.p,ok1.p}; identifier r.i; struct videobuf_queue_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct videobuf_queue_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: media: atomisp: use kvmalloc/kvzallocGeliang Tang2017-08-094-36/+3Star
| | | | | | | | | Use kvmalloc()/kvzalloc() instead of atomisp_kernel_malloc() /atomisp_kernel_zalloc(). Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: atomisp2: don't set driver_versionHans Verkuil2017-08-081-5/+1Star
| | | | | | | This field will be removed as it is not needed anymore. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* Merge tag 'v4.13-rc4' into patchworkMauro Carvalho Chehab2017-08-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 4.13-rc4 * tag 'v4.13-rc4': (863 commits) Linux 4.13-rc4 Fix compat_sys_sigpending breakage ext4: fix copy paste error in ext4_swap_extents() ext4: fix overflow caused by missing cast in ext4_resize_fs() ext4, project: expand inode extra size if possible ext4: cleanup ext4_expand_extra_isize_ea() ext4: restructure ext4_expand_extra_isize ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize ext4: make xattr inode reads faster ext4: inplace xattr block update fails to deduplicate blocks ext4: remove unused mode parameter ext4: fix warning about stack corruption ext4: fix dir_nlink behaviour ext4: silence array overflow warning ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize platform/x86: intel-vbtn: match power button on press rather than release ext4: release discard bio after sending discard commands sparc64: Fix exception handling in UltraSPARC-III memcpy. arm64: avoid overflow in VA_START and PAGE_OFFSET arm64: Fix potential race with hardware DBM in ptep_set_access_flags() ...
| * media: atomisp2: Array underflow in atomisp_enum_input()Dan Carpenter2017-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem here is this code from atomisp_enum_input(): 581 int index = input->index; 582 583 if (index >= isp->input_cnt) 584 return -EINVAL; 585 586 if (!isp->inputs[index].camera) 587 return -EINVAL; "input->index" is a u32 which comes from the ioctl. We want negative values of "index" to be counted as -EINVAL but they aren't. I've fixed this by changing the type of "isp->input_cnt" to unsigned int. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: atomisp: use LINUX_VERSION_CODE for driver versionMauro Carvalho Chehab2017-07-204-33/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | | The atomisp subdev driver hardcodes its version to ATOMISP_CSS_VERSION_21. Yet, it has several tests for versions below 21 internally, with sounds really odd. On all other media drivers, we're just keeping version set to LINUX_VERSION_CODE. So, do the same here, simplifying the code a little bit. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: fixed trivial coding style issueShy More2017-07-191-2/+1Star
| | | | | | | | | | | | | | | | | | Below was the trival error flagged by checkpatch.pl: ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Shy More <smklearn@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: fixed trivial coding style warningShy More2017-07-191-12/+12
| | | | | | | | | | | | | | | | | | Below was the trivial wanrning flagged by checkpatch.pl WARNING: Block comments use * on subsequent lines Signed-off-by: Shy More <smklearn@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: hmm: Alignment code (rebased)Philipp Guendisch2017-07-191-48/+45Star
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixed code alignment to open paranthesis. Semantic should not be affected by this patch. It has been rebased on top of media_tree atomisp branch Signed-off-by: Philipp Guendisch <philipp.guendisch@fau.de> Signed-off-by: Chris Baller <chris.baller@gmx.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: hmm: Fixed comment stylePhilipp Guendisch2017-07-191-21/+23
| | | | | | | | | | | | | | | | | | | | | | This patch fixed comment style. Semantic should not be affected. There are also two warnings left about too long lines, which reduce readability if changed. Signed-off-by: Philipp Guendisch <philipp.guendisch@fau.de> Signed-off-by: Chris Baller <chris.baller@gmx.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: Use kvfree() instead of kfree()/vfree()Amitoj Kaur Chawla2017-07-194-21/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conditionally calling kfree()/vfree() can be replaced by a call to kvfree() which handles both kmalloced memory and vmalloced memory. The resulting wrapper function has been replaced with direct calls to kvfree(). This change was made with the help of the following Coccinelle semantic patch: //<smpl> @@ expression a; @@ - if(...) { vfree(a); } - else { kfree(a); } + kvfree(a); // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: use kstrdup to replace kmalloc and memcpyHari Prasath2017-07-191-6/+2Star
| | | | | | | | | | | | | | | | | | kstrdup kernel primitive can be used to replace kmalloc followed by string copy. This was reported by coccinelle tool. Signed-off-by: Hari Prasath <gehariprasath@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: staging: atomisp: Remove unnecessary return statement in void functionAmitoj Kaur Chawla2017-07-191-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | Return statement at the end of a void function is useless. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ identifier f; expression e; @@ void f(...) { <... - return e; ...> } //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: staging: atomisp: disable warnings with cc-disable-warningMauro Carvalho Chehab2017-07-171-4/+6
| | | | | | | Instead of directly using -Wno-foo, use cc-disable-warning, as it checks if the compiler has the warnings we want to disable. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] staging: css2400/Makefile: don't include non-existing filesMauro Carvalho Chehab2017-06-081-2/+0Star
| | | | | | | | | | | | The atomisp css2400/Makefile includes a Makefile.common: include $(srctree)/$(src)/../Makefile.common Well, this file doesn't exist at the Kernel tree :-) So, don't include it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] staging: atomisp: Fix endless recursion in hmm_initHans de Goede2017-06-071-1/+5
| | | | | | | | | | | | | | | | hmm_init calls hmm_alloc to set dummy_ptr, hmm_alloc calls hmm_init when dummy_ptr is not yet set, which is the case in the call from hmm_init, so it calls hmm_init again, this continues until we have a stack overflow due to the recursion. This commit fixes this by adding a separate flag for tracking if hmm_init has been called. Not pretty, but it gets the job done, eventually we should be able to remove the hmm_init call from hmm_alloc. 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>
* [media] atomisp: de-duplicate sh_css_mmu_set_page_table_base_indexAlan Cox2017-06-073-31/+1Star
| | | | | | | | | | Between the ISP2400 and ISP2401 code base this function moved file. The merge of the drivers left us with two version in ifdefs. Resolve this down to a single copy. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: remove sh_css_irq - it contains nothingAlan Cox2017-06-072-17/+0Star
| | | | | | | | We won't be adding abstractions or moving them here so kill it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Unify lut free logicAlan Cox2017-06-072-21/+0Star
| | | | | | | | | ISP2401 introduced a helper for this which we can use just as well on the ISP2400 and remove some more noise differences. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: Unify load_preview_binaries for the most partAlan Cox2017-06-071-39/+1Star
| | | | | | | | | | ISP2401 introduced a rather sensible change to cut through the structure spaghetti. Adopt that for the ISP2400 as well. It makes no difference to the actual code other than readability. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: unify sh_css_hmm_buffer_record_acquireAlan Cox2017-06-071-37/+3Star
| | | | | | | | | | The ISP2401 version of this function returns a pointer to the buffer, whilst the ISP2400 version returns a boolean if a slot is found. We can trivially unify the code to use the ISP2401 version. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp: eliminate dead code under HAS_RES_MGRAlan Cox2017-06-074-103/+0Star
| | | | | | | | | This define is never set and these code paths are never used so they can go away. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atomisp2: off by one in atomisp_s_input()Dan Carpenter2017-06-071-1/+1
| | | | | | | | | | | | | | | The isp->inputs[] array has isp->input_cnt elements which have been initialized so this > should be >=. This bug is harmless. The check against ATOM_ISP_MAX_INPUTS prevents us from reading beyond the end of the array. The uninitialized elements are zeroed out so we will end up returning -EINVAL a few lines later because the .camera pointer is NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>