aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/rtl2832_sdr.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-07-08[media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil1-1/+1
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-05-04[media] rtl2832_sdr: get rid of empty regmap wrappersPeter Rosin1-170/+132
Tested-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-04[media] rtl2832: change the i2c gate to be mux-lockedPeter Rosin1-6/+7
The root i2c adapter lock is then no longer held by the i2c mux during accesses behind the i2c gate, and such accesses need to take that lock just like any other ordinary i2c accesses do. So, declare the i2c gate mux-locked, and zap the regmap overrides that makes the i2c accesses unlocked and use plain old regmap accesses. This also removes the need for the regmap wrappers used by rtl2832_sdr, so deconvolute the code further and provide the regmap handle directly instead of the wrapper functions. Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-12-18[media] media: videobuf2: Move timestamp to vb2_bufferJunghak Sung1-1/+1
Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-18[media] vb2: drop v4l2_format argument from queue_setupHans Verkuil1-1/+1
The queue_setup callback has a void pointer that is just for V4L2 and is the pointer to the v4l2_format struct that was passed to VIDIOC_CREATE_BUFS. The idea was that drivers would use the information from that struct to buffers suitable for the requested format. After the vb2 split series this pointer is now a void pointer, which is ugly, and the reality is that all existing drivers will effectively just look at the sizeimage field of v4l2_format. To make this more generic the queue_setup callback is changed: the void pointer is dropped, instead if the *num_planes argument is 0, then use the current format size, if it is non-zero, then it contains the number of requested planes and the sizes array contains the requested sizes. If either is unsupported, then return -EINVAL, otherwise use the requested size(s). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-20[media] media: videobuf2: Change queue_setup argumentJunghak Sung1-1/+1
Replace struct v4l2_format * with void * to make queue_setup() for common use. And then, modify all device drivers related with this change. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix missing const in fimc-lite.c] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01[media] media: videobuf2: Restructure vb2_bufferJunghak Sung1-9/+12
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer. Add new member variables - bytesused, length, offset, userptr, fd, data_offset - to struct vb2_plane in order to cover all information of v4l2_plane. struct vb2_plane { <snip> unsigned int bytesused; unsigned int length; union { unsigned int offset; unsigned long userptr; int fd; } m; unsigned int data_offset; } Replace v4l2_buf with new member variables - index, type, memory - which are common fields for buffer management. struct vb2_buffer { <snip> unsigned int index; unsigned int type; unsigned int memory; unsigned int num_planes; struct vb2_plane planes[VIDEO_MAX_PLANES]; <snip> }; v4l2 specific fields - flags, field, timestamp, timecode, sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c struct vb2_v4l2_buffer { struct vb2_buffer vb2_buf; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; }; Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-08-11[media] dvb-frontends: Drop owner assignment from platform_driverKrzysztof Kozlowski1-1/+0
platform_driver does not need to set an owner because platform_driver_register() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-20[media] rtl2832_sdr: cleanup some set_bit() callsDan Carpenter1-5/+5
This code works fine but static checkers complain. The test_bit() function takes the bit number and not a mask. Then the other issue is that we were using USB_STATE_URB_BUF which is BIT(0) instead of URB_BUF. Also we were open coding that instead of using the test/clear/set_bit() functions. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-18[media] rtl2832_sdr: add support for fc2580 tunerAntti Palosaari1-19/+91
Add initial support for fc2580 tuner based devices. Tuner is controlled via V4L2 subdevice API. Passes v4l2-compliance tests. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: refcount to rtl28xxuAntti Palosaari1-2/+15
We are consumer of DVB frontend provided by rtl28xxu module. Due to that we must use refcount to ensure none could remove rtl28xxu when we are alive (or when we are streaming, if more fine-grained refcounting is wanted). Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: cleanupsAntti Palosaari1-23/+23
Small cleanups. Remove unneeded variables. Some checkpatch issues. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: fix loggingAntti Palosaari1-65/+86
Pass correct device, platform device, for logging system in order to format printouts correctly. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: convert to platform driverAntti Palosaari1-232/+123
That SDR driver module was abusing DVB frontend SEC (satellite equipment controller) device and due to that it was also using legacy DVB binding. Platform bus is pseudo-bus provided by kernel driver model and it fits cases like that, where any other busses are not suitable. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: rename state variable from 's' to 'dev'Antti Palosaari1-429/+429
'dev' sounds better than 's' for such variable. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04[media] rtl2832_sdr: control ADCAntti Palosaari1-0/+8
Recent rtl28xxu patch I made moved demod ADC enable from power control to frontend control (due to slave demod support). Because of that we need call USB interface frontend control too in order to enable ADC. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] rtl2832_sdr: logging changesAntti Palosaari1-53/+45
Remove function name from debug logs. Logging system could add it automatically. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] rtl2832_sdr: enhance sample rate debug calculation precisionAntti Palosaari1-5/+7
Sample rate calculation gives a little bit too large results because in real life there was around one milliseconds (~one usb packet) too much data for given time. Calculate time more accurate in order to provide better results. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] rtl2832_sdr: remove unneeded spinlock irq flags initializationAntti Palosaari1-3/+3
There is no need to init flags before calling spin_lock_irqsave(). spin_lock_irqsave is macro which stores value to 'flags' Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-03[media] af9013: use true/false for boolean varsMauro Carvalho Chehab1-1/+1
Instead of using 0 or 1 for boolean, use the true/false defines. Also, instead of testing foo == false, just use the simplified notation if(!foo). Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22[media] rtl2832_sdr: remove plain 64-bit divisionsAntti Palosaari1-3/+2
Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 (v4l2-ctrls: increase internal min/max/step/def to 64 bit) changes v4l2 controls to 64-bit. Driver it not working on 32-bit arch as it uses directly control 'step' which is changed to 64-bit. Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] rtl2832_sdr: fill FMT buffer sizeAntti Palosaari1-7/+20
Fill FMT buffer size field in order to inform app which will be used streaming buffer size. Currently driver doesn't allow buffer size value proposed by application. Signed-off-by: Antti Palosaari <crope@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] rtl2832_sdr: print notice to point SDR API is not 100% stable yetAntti Palosaari1-0/+3
SDR API is very new and surprises may occur. Due to that print notice to remind possible users. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] rtl2832_sdr: put complex U16 format behind module parameterAntti Palosaari1-5/+13
Move emulated format behind module parameter as those are not supported. Format conversions will be on library eventually. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21rtl2832_sdr: move from staging to mediaAntti Palosaari1-0/+1528
Move rtl2832_sdr driver module from staging to media. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>