aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-07-13[media] tw686x: Support VIDIOC_{S,G}_PARM ioctlsEzequiel Garcia1-3/+43
Now that the frame rate can be properly set, this commit adds support for S_PARM and G_PARM. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-13[media] tw686x: use a formula instead of two tables for divMauro Carvalho Chehab1-34/+61
Instead of using two tables to estimate the temporal decimation factor, use a formula. This allows to get the closest fps, which sounds better than the current tables. Also, the current code doesn't store the real framerate. This patch fixes the above issues. [Ezequiel: - introduce a TW686X_MAX_FPS macro for max_fps. - use hweight_long instead of open coding the set bits count.] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-13[media] netup_unidvb: trivial fix of spelling mistake "initizalize" -> "initialize"Colin Ian King1-1/+1
trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] cx23885: Add support for Hauppauge WinTV quadHD DVB versionStephen Backway3-14/+146
Add support fo the Hauppauge WinTV quadHD DVB version. IR support has not been provided, all 4 tuners, demodulators etc are working. Further documentation can be found on Linux TV wiki. Signed-off-by: Stephen Backway <stev391@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] ezkit/cobalt: drop unused op_656_range settingHans Verkuil1-2/+0
The adv7604/adv7842 drivers now handle that register setting themselves and need no input from platform data anymore. This was a left-over from the time that the pixelport output format was decided by the platform data. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] media: solo6x10: increase FRAME_BUF_SIZEAndrey Utkin1-1/+1
In practice, devices sometimes return frames larger than current buffer size, leading to failure in solo_send_desc(). It is not clear which minimal increase in buffer size would be enough, so this patch doubles it, this should be safely assumed as sufficient. Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] ivtv: use v4l2_g/s_ctrl instead of the g/s_ctrl opsHans Verkuil1-3/+3
These ops are deprecated and should not be used anymore. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] cx18: use v4l2_g/s_ctrl instead of the g/s_ctrl opsHans Verkuil1-3/+3
These ops are deprecated and should not be used anymore. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] cx88: use wm8775_s_ctrl instead of the s_ctrl opHans Verkuil1-6/+2
This op is deprecated and should not be used anymore. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12[media] saa7164: drop unused saa7164_ctrl structHans Verkuil1-4/+0
No longer used, can be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] tw686x: make const structs staticHans Verkuil1-3/+3
Fix sparse warnings: tw686x-video.c:148:29: warning: symbol 'memcpy_dma_ops' was not declared. Should it be static? tw686x-video.c:195:29: warning: symbol 'contig_dma_ops' was not declared. Should it be static? tw686x-video.c:361:29: warning: symbol 'sg_dma_ops' was not declared. Should it be static? Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] ddbridge: Replace vmalloc with vzallocAmitoj Kaur Chawla1-2/+1
vzalloc combines vmalloc and memset 0. The Coccinelle semantic patch used to make this change is as follows: @@ type T; T *d; expression e; statement S; @@ d = - vmalloc + vzalloc (...); if (!d) S - memset(d, 0, sizeof(T)); Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] saa7164: Replace if and BUG with BUG_ONAmitoj Kaur Chawla1-4/+2
Replace if condition and BUG() with a BUG_ON having the conditional expression of the if statement as argument. The Coccinelle semantic patch used to make this change is as follows: @@ expression E,f; @@ ( if (<+... f(...) ...+>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] bt8xx: remove needless module refcountingAlexey Khoroshilov1-2/+0
It is responsibility of a caller of fops->open(), to make sure an owner of the fops is available until file is closed. So, there is no need to lock THIS_MODULE explicitly. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil21-21/+21
Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] media/pci/tw686x: convert driver to use the new vb2_queue dev fieldHans Verkuil2-36/+1
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] media/pci: convert drivers to use the new vb2_queue dev fieldHans Verkuil32-143/+31
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] solo6x10: Simplify solo_enum_ext_inputIsmael Luceno1-18/+16
Additionally, now it specifies which channels it's showing. Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: be explicit about the possible dma_mode optionsHans Verkuil1-1/+1
Users won't know what to put in this module option if it isn't described. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: audio: Prevent hw param changes while busyEzequiel Garcia2-4/+17
Audio hw params are shared across all DMA channels, so if the user changes any of these while any DMA channel is enabled, it will impact the enabled channels, potentially causing serious instability issues. This commit avoids such situation, by preventing any hw param change (on any DMA channel) if any other DMA audio channel is capturing. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: audio: Allow to configure the period sizeEzequiel Garcia3-23/+34
Currently, the driver has a fixed period size of 4096 bytes (2048 frames). Since this hardware can configure the audio capture size, this commit allows a period size range of [512-4096]. This is very useful to reduce the audio latency. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: audio: Implement non-memcpy captureEzequiel Garcia1-4/+28
Now that we've introduced the dma_mode parameter to pick the DMA operation, let's use it to also select the audio DMA operation. When dma_mode != memcpy, the driver will avoid using memcpy in the audio capture path, and the DMA hardware operation will act directly on the ALSA buffers. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: Add support for DMA scatter-gather modeEzequiel Garcia4-0/+207
Now that the driver has the infrastructure to support more DMA modes, let's add the DMA scatter-gather mode. In this mode, the device delivers sequential top-bottom frames. The scatter-gather logic is based on staging's tw686x-kh driver (by Krzysztof Ha?asa). Tested-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: Add support for DMA contiguous interlaced frame modeEzequiel Garcia4-0/+56
Now that the driver has the infrastructure to support more DMA modes, let's add the DMA contiguous interlaced frame mode. In this mode, the DMA P and B buffers are programmed with the user-provided buffers. When a P (or B) frame is ready, a new buffer is dequeued into P (or B). In addition to interlaced fields, the device can also be programmed to deliver alternate fields. Only interlaced mode is supported for now. Tested-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-28[media] tw686x: Introduce an interface to support multiple DMA modesEzequiel Garcia4-121/+206
Let's set the corner stone to support all the DMA modes available on this device. For stability reasons, the driver is currently setting DMA frame mode, and using single DMA buffers to get the P and B buffers. Each frame is then memcpy'ed into the user buffer. However, other platforms might be interested in avoiding this memcpy, or in taking advantage of the chip's DMA scatter-gather capabilities. To achieve this, this commit introduces a "dma_mode" module parameter, and a tw686x_dma_ops struct. This will allow to define functions to alloc/free DMA buffers, and to return the frames to userspace. The memcpy-based method described above is named as dma_mode="memcpy". Current alloc/free functions are renamed as tw686x_memcpy_xxx, and are now used through a memcpy_dma_ops. Tested-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-24zr36016: remove some unused tablesMauro Carvalho Chehab1-4/+0
Gcc 6.1 warns about some unused tables: drivers/media/pci/zoran/zr36016.c:251:18: warning: 'zr016_yoff' defined but not used [-Wunused-const-variable=] static const int zr016_yoff[] = { 8, 9, 7 }; ^~~~~~~~~~ drivers/media/pci/zoran/zr36016.c:250:18: warning: 'zr016_xoff' defined but not used [-Wunused-const-variable=] static const int zr016_xoff[] = { 20, 20, 20 }; ^~~~~~~~~~ Those tables aren't used anywere. So, remove them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-24cx25821-alsa: shutup a Gcc 6.1 warningMauro Carvalho Chehab1-1/+1
The PCI device ID table is only used if compiled with modules support. When compiled with modules disabled, this is now producing this bogus warning: drivers/media/pci/cx25821/cx25821-alsa.c:696:35: warning: 'cx25821_audio_pci_tbl' defined but not used [-Wunused-const-variable=] static const struct pci_device_id cx25821_audio_pci_tbl[] = { ^~~~~~~~~~~~~~~~~~~~~ Fix it by annotating that the function may not be used. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-24cx18: use macros instead of static const varsMauro Carvalho Chehab5-14/+14
Gcc 6.1 now complains about unused vars: drivers/media/pci/cx18/cx18-driver.h:497:18: warning: 'vbi_hblank_samples_50Hz' defined but not used [-Wunused-const-variable=] static const u32 vbi_hblank_samples_50Hz = 284; /* 4 byte EAV + 280 anc/fill */ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/pci/cx18/cx18-driver.h:496:18: warning: 'vbi_hblank_samples_60Hz' defined but not used [-Wunused-const-variable=] static const u32 vbi_hblank_samples_60Hz = 272; /* 4 byte EAV + 268 anc/fill */ ^~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/media/pci/cx18/cx18-cards.c:25:0: drivers/media/pci/cx18/cx18-driver.h:497:18: warning: 'vbi_hblank_samples_50Hz' defined but not used [-Wunused-const-variable=] static const u32 vbi_hblank_samples_50Hz = 284; /* 4 byte EAV + 280 anc/fill */ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/pci/cx18/cx18-driver.h:496:18: warning: 'vbi_hblank_samples_60Hz' defined but not used [-Wunused-const-variable=] static const u32 vbi_hblank_samples_60Hz = 272; /* 4 byte EAV + 268 anc/fill */ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/media/pci/cx18/cx18-driver.h:495:18: warning: 'vbi_active_samples' defined but not used [-Wunused-const-variable=] static const u32 vbi_active_samples = 1444; /* 4 byte SAV + 720 Y + 720 U/V */ ^~~~~~~~~~~~~~~~~~ In this specific case, this is somewhat intentional, as those values are actually used in parts of the driver. The code assumes that gcc optimizer it and not actually create any var, but convert it to immediate access at the routines. Yet, as we want to shut up gcc warnings, let's use #define, with is the standard way to store values that will use assembler's immediate access code. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-07[media] Change frontend allocation strategy for NetUP Universal DVB cardsAbylay Ospan1-59/+7
Old behaviour: frontend0 - DVB-S/S2 frontend1 - DVB-T/T2 frontend2 - DVB-C frontend3 - ISDB-T New behaviour (DVBv5 API compliant): frontend0 - DVB-S/S2 frontend1 - DVB-T/T2/C/ISDB-T DTV standard should be selected by DTV_DELIVERY_SYSTEM call. And DVB-C default bandwidth now 8MHz Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-06-07[media] Fix CAM module memory read/writeAbylay Ospan1-2/+2
mistakenly membase8_io used instead of membase8_config in this case we can't read/write CAM module memory (TUPLES) Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-06-07[media] New hw revision 1.4 of NetUP Universal DVB card addedAbylay Ospan2-55/+161
New hardware revision of NetUP Universal DVB card (rev 1.4): * changed tuners (CXD2861ER and CXD2832AER) to CXD2858ER * changed demodulator (CXD2841ER) to CXD2854ER card now supports: DVB-S/S2, DVB-T/T2, DVB-C/C2, ISDB-T PCI id's assigned for new hardware revision is: 1b55:18f7 Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-06-07[media] Add support Sony HELENE Sat/Ter TunerAbylay Ospan1-1/+6
This is Sony HELENE DVB-S/S2 DVB-T/T2 DVB-C/C2 ISDB-T/S tuner driver (CXD2858ER). Tuner is used on NetUP Dual Universal DVB CI card (hardware revision 1.4). Use 'helene_attach_s' to attach tuner in 'satellite mode'. Use 'helene_attach' for 'terrestrial mode'. Satellite delivery systems supported: DVB-S/S2, ISDB-S Terrestrial delivery systems supported: DVB-T/T2, ISDB-T Cable delivery systems supported: DVB-C/C2 Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-07[media] smipcie: add RC map into card configuration optionsOlli Salonen3-4/+6
Remove the if..else statement from smipcie-ir.c and add the remote controller map as a configuration parameter for the card. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-07[media] smipcie: MAC address printout formattingOlli Salonen1-1/+2
Modify the printout for MAC address to be more vendor agnostic. Print also the port number. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-07[media] smipcie: add support for TechnoTrend S2-4200 TwinOlli Salonen3-1/+15
Add support for TechnoTrend TT-budget S2-4200 Twin DVB-S2 tuner. The device seems to be rather similar to DVBSky S952 V3. This is a PCIe card with 2 tuners. SMI PCIe bridge is used and the card has two Montage M88RS6000 demod/tuners. The M88RS6000 demod/tuner package needs firmware. You can download one here: http://palosaari.fi/linux/v4l-dvb/firmware/M88RS6000/ Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Max Nibble <nibble.max@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-07[media] drivers/media/pci/zoran: avoid fragile snprintf useRasmus Villemoes1-2/+3
Appending to a string by doing snprintf(buf, bufsize, "%s...", buf, ...) is not guaranteed to work. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-26[media] tw686x: avoid going past arrayMauro Carvalho Chehab1-2/+2
Fix those two warnings: drivers/media/pci/tw686x/tw686x-video.c:69 tw686x_fields_map() error: buffer overflow 'std_525_60' 31 <= 31 drivers/media/pci/tw686x/tw686x-video.c:73 tw686x_fields_map() error: buffer overflow 'std_625_50' 26 <= 26 I had those changes at the last version of my patch, but I ended by merging the previous version by mistake. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-25[media] tw686x: Don't go past arrayMauro Carvalho Chehab1-2/+11
Depending on the compiler version, currently it produces the following warnings: tw686x-video.c: In function 'tw686x_video_init': tw686x-video.c:65:543: warning: array subscript is above array bounds [-Warray-bounds] This is actually bogus with the current code, as it currently hardcodes the framerate to 30 frames/sec, however a potential use after the array size could happen when the driver adds support for setting the framerate. So, fix it. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-25[media] sta2x11: remove unused varsMauro Carvalho Chehab1-2/+0
Changeset 7b9f31f3b3ca ("[media] sta2x11_vip: fix s_std") removed autodetect code, but it kept two vars unused: drivers/media/pci/sta2x11/sta2x11_vip.c: In function 'vidioc_s_std': drivers/media/pci/sta2x11/sta2x11_vip.c:448:6: warning: unused variable 'status' [-Wunused-variable] int status; ^ drivers/media/pci/sta2x11/sta2x11_vip.c:447:14: warning: unused variable 'oldstd' [-Wunused-variable] v4l2_std_id oldstd = vip->std; ^ Remove them. Fixes: 7b9f31f3b3ca ("[media] sta2x11_vip: fix s_std") Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-25[media] sta2x11_vip: fix s_stdHans Verkuil1-16/+10
The s_std ioctl was broken in this driver, partially due to the changes to the adv7180 driver (this affected the handling of V4L2_STD_ALL) and partially because the new standard was never stored in vip->std. The handling of V4L2_STD_ALL has been rewritten to just call querystd and the new standard is now stored correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-25[media] tw686x-video: test for 60Hz instead of 50HzHans Verkuil1-4/+4
When determining if the standard is 50 or 60 Hz it is standard practice to test for 60 Hz instead of 50 Hz. This doesn't matter normally, except if the user specifies both 60 and 50 Hz standards. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-20[media] ivtv/cx18: use the new mask variants of the v4l2_device_call_* definesHans Verkuil2-22/+4
Instead of rolling our own define, just use the new mask defines. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-20[media] tw686x: Specify that the DMA is 32 bitsEzequiel Garcia1-0/+1
Set vb2_queue.gfp_flags to GFP_DMA32. Otherwise it will start to create bounce buffers which is something you want to avoid since those are in limited supply. Without this patch, DMA scatter-gather may not work because machines can ran out of buffers easily. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-20[media] tw686x: add missing staticsHans Verkuil1-2/+2
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-20[media] media: Support Intersil/Techwell TW686x-based video capture cardsEzequiel Garcia9-0/+2031
This commit introduces the support for the Techwell TW686x video capture IC. This hardware supports a few DMA modes, including scatter-gather and frame (contiguous). This commit makes little use of the DMA engine and instead has a memcpy based implementation. DMA frame and scatter-gather modes support may be added in the future. Currently supported chips: - TW6864 (4 video channels), - TW6865 (4 video channels, not tested, second generation chip), - TW6868 (8 video channels but only 4 first channels using built-in video decoder are supported, not tested), - TW6869 (8 video channels, second generation chip). [mchehab@osg.samsung.com: make checkpatch happy by using "unsigned int" instead of just "unsigned"] Cc: Krzysztof Halasa <khalasa@piap.pl> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-13[media] cx23885: uninitialized variable in cx23885_av_work_handler()Dan Carpenter1-1/+1
The "handled" variable could be uninitialized if the interrupt_service_routine() call back hasn't been implimented or if it has been implemented but doesn't initialize "handled" to zero at the start. For example, adv76xx_isr() only sets "handled" to true. Fixes: 44b153ca639f ('[media] m5mols: Add ISO sensitivity controls') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-04-13[media] cobalt: add MTD dependencyArnd Bergmann1-0/+1
The cobalt driver fails to link when it is built-in and MTD is disabled or a loadable module: drivers/media/built-in.o: In function `cobalt_flash_probe': :(.text+0xb8b46): undefined reference to `mtd_device_parse_register' :(.text+0xb8b88): undefined reference to `do_map_probe' drivers/media/built-in.o: In function `cobalt_flash_remove': :(.text+0xb8bb4): undefined reference to `mtd_device_unregister' :(.text+0xb8bbe): undefined reference to `map_destroy' This adds a Kconfig dependency to ensure we can call the API. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-20Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds2-8/+6
Pull x86 protection key support from Ingo Molnar: "This tree adds support for a new memory protection hardware feature that is available in upcoming Intel CPUs: 'protection keys' (pkeys). There's a background article at LWN.net: https://lwn.net/Articles/643797/ The gist is that protection keys allow the encoding of user-controllable permission masks in the pte. So instead of having a fixed protection mask in the pte (which needs a system call to change and works on a per page basis), the user can map a (handful of) protection mask variants and can change the masks runtime relatively cheaply, without having to change every single page in the affected virtual memory range. This allows the dynamic switching of the protection bits of large amounts of virtual memory, via user-space instructions. It also allows more precise control of MMU permission bits: for example the executable bit is separate from the read bit (see more about that below). This tree adds the MM infrastructure and low level x86 glue needed for that, plus it adds a high level API to make use of protection keys - if a user-space application calls: mmap(..., PROT_EXEC); or mprotect(ptr, sz, PROT_EXEC); (note PROT_EXEC-only, without PROT_READ/WRITE), the kernel will notice this special case, and will set a special protection key on this memory range. It also sets the appropriate bits in the Protection Keys User Rights (PKRU) register so that the memory becomes unreadable and unwritable. So using protection keys the kernel is able to implement 'true' PROT_EXEC on x86 CPUs: without protection keys PROT_EXEC implies PROT_READ as well. Unreadable executable mappings have security advantages: they cannot be read via information leaks to figure out ASLR details, nor can they be scanned for ROP gadgets - and they cannot be used by exploits for data purposes either. We know about no user-space code that relies on pure PROT_EXEC mappings today, but binary loaders could start making use of this new feature to map binaries and libraries in a more secure fashion. There is other pending pkeys work that offers more high level system call APIs to manage protection keys - but those are not part of this pull request. Right now there's a Kconfig that controls this feature (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) that is default enabled (like most x86 CPU feature enablement code that has no runtime overhead), but it's not user-configurable at the moment. If there's any serious problem with this then we can make it configurable and/or flip the default" * 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (38 commits) x86/mm/pkeys: Fix mismerge of protection keys CPUID bits mm/pkeys: Fix siginfo ABI breakage caused by new u64 field x86/mm/pkeys: Fix access_error() denial of writes to write-only VMA mm/core, x86/mm/pkeys: Add execute-only protection keys support x86/mm/pkeys: Create an x86 arch_calc_vm_prot_bits() for VMA flags x86/mm/pkeys: Allow kernel to modify user pkey rights register x86/fpu: Allow setting of XSAVE state x86/mm: Factor out LDT init from context init mm/core, x86/mm/pkeys: Add arch_validate_pkey() mm/core, arch, powerpc: Pass a protection key in to calc_vm_flag_bits() x86/mm/pkeys: Actually enable Memory Protection Keys in the CPU x86/mm/pkeys: Add Kconfig prompt to existing config option x86/mm/pkeys: Dump pkey from VMA in /proc/pid/smaps x86/mm/pkeys: Dump PKRU with other kernel registers mm/core, x86/mm/pkeys: Differentiate instruction fetches x86/mm/pkeys: Optimize fault handling in access_error() mm/core: Do not enforce PKEY permissions on remote mm access um, pkeys: Add UML arch_*_access_permitted() methods mm/gup, x86/mm/pkeys: Check VMAs and PTEs for protection keys x86/mm/gup: Simplify get_user_pages() PTE bit handling ...
2016-03-03[media] saa7134: fix warning with !MEDIA_CONTROLLERArnd Bergmann1-2/+2
When CONFIG_MEDIA_CONTROLLER is disabled, we get a warning about an unused function: drivers/media/pci/saa7134/saa7134-core.c:832:13: error: 'saa7134_create_entities' defined but not used [-Werror=unused-function] This moves the #ifdef outside of the function, as it is never called here. Fixes: ac90aa02d5b9 ("[media] saa7134: add media controller support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-03[media] cx23885: incorrect I2C bus used in the CI registrationOlli Salonen1-2/+2
This patch fixes a bug that was introduced by the commit: commit 2b0aac3011bc7a9db27791bed4978554263ef079 Author: Mauro Carvalho Chehab <mchehab@osg.samsung.com> [media] cx23885: move CI/MAC registration to a separate function Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>