aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/au8522_decoder.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-03-03[media] au0828: use standard demod pads structMauro Carvalho Chehab1-4/+4
As we want au0828 to use the core function to create the MC graphs, use enum demod_pad_index instead of enum au8522_media_pads. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27[media] media: au8522 change to create MC pad for ALSA Audio OutShuah Khan1-0/+1
Add new pad for ALSA Audio Out to au8522_media_pads. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media framework: rename pads init function to media_entity_pads_init()Mauro Carvalho Chehab1-1/+1
With the MC next gen rework, what's left for media_entity_init() is to just initialize the PADs. However, certain devices, like a FLASH led/light doesn't have any input or output PAD. So, there's no reason why calling media_entity_init() would be mandatory. Also, despite its name, what this function actually does is to initialize the PADs data. So, rename it to media_entity_pads_init() in order to reflect that. The media entity actual init happens during entity register, at media_device_register_entity(). We should move init of num_links and num_backlinks to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] uapi/media.h: Rename entities types to functionsMauro Carvalho Chehab1-1/+1
Rename the userspace types from MEDIA_ENT_T_ to MEDIA_ENT_F_ and add the backward compatibility bits. The changes at the .c files was generated by the following coccinelle script: @@ @@ -MEDIA_ENT_T_UNKNOWN +MEDIA_ENT_F_UNKNOWN @@ @@ -MEDIA_ENT_T_DVB_BASE +MEDIA_ENT_F_DVB_BASE @@ @@ -MEDIA_ENT_T_V4L2_BASE +MEDIA_ENT_F_V4L2_BASE @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_BASE +MEDIA_ENT_F_V4L2_SUBDEV_BASE @@ @@ -MEDIA_ENT_T_CONNECTOR_BASE +MEDIA_ENT_F_CONNECTOR_BASE @@ @@ -MEDIA_ENT_T_V4L2_VIDEO +MEDIA_ENT_F_IO_V4L @@ @@ -MEDIA_ENT_T_V4L2_VBI +MEDIA_ENT_F_IO_VBI @@ @@ -MEDIA_ENT_T_V4L2_SWRADIO +MEDIA_ENT_F_IO_SWRADIO @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN +MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN @@ @@ -MEDIA_ENT_T_CONN_RF +MEDIA_ENT_F_CONN_RF @@ @@ -MEDIA_ENT_T_CONN_SVIDEO +MEDIA_ENT_F_CONN_SVIDEO @@ @@ -MEDIA_ENT_T_CONN_COMPOSITE +MEDIA_ENT_F_CONN_COMPOSITE @@ @@ -MEDIA_ENT_T_CONN_TEST +MEDIA_ENT_F_CONN_TEST @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_SENSOR +MEDIA_ENT_F_CAM_SENSOR @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_FLASH +MEDIA_ENT_F_FLASH @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_LENS +MEDIA_ENT_F_LENS @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_DECODER +MEDIA_ENT_F_ATV_DECODER @@ @@ -MEDIA_ENT_T_V4L2_SUBDEV_TUNER +MEDIA_ENT_F_TUNER @@ @@ -MEDIA_ENT_T_DVB_DEMOD +MEDIA_ENT_F_DTV_DEMOD @@ @@ -MEDIA_ENT_T_DVB_DEMUX +MEDIA_ENT_F_TS_DEMUX @@ @@ -MEDIA_ENT_T_DVB_TSOUT +MEDIA_ENT_F_IO_DTV @@ @@ -MEDIA_ENT_T_DVB_CA +MEDIA_ENT_F_DTV_CA @@ @@ -MEDIA_ENT_T_DVB_NET_DECAP +MEDIA_ENT_F_DTV_NET_DECAP Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media-entity.h: rename entity.type to entity.functionMauro Carvalho Chehab1-1/+1
Entities should have one or more functions. Calling it as a type proofed to not be correct, as an entity could eventually have more than one type. So, rename the field as function. Please notice that this patch doesn't extend support for multiple function entities. Such change will happen when we have real case drivers using it. No functional changes. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab1-1/+1
Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] au0828: Add support for media controllerRafael Lourenço de Lima Chehab1-0/+17
Add support for analog and dvb tv using media controller. Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-21[media] au8522: Avoid memory leak for device config dataMauro Carvalho Chehab1-12/+2
As reported by kmemleak: unreferenced object 0xffff880321e1da40 (size 32): comm "modprobe", pid 3309, jiffies 4295019569 (age 2359.636s) hex dump (first 32 bytes): 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 G............... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff82278c8e>] kmemleak_alloc+0x4e/0xb0 [<ffffffff8153c08c>] kmem_cache_alloc_trace+0x1ec/0x280 [<ffffffffa13a896a>] au8522_probe+0x19a/0xa30 [au8522_decoder] [<ffffffff81de0032>] i2c_device_probe+0x2b2/0x490 [<ffffffff81ca7004>] driver_probe_device+0x454/0xd90 [<ffffffff81ca7c1b>] __device_attach_driver+0x17b/0x230 [<ffffffff81ca15da>] bus_for_each_drv+0x11a/0x1b0 [<ffffffff81ca6a4d>] __device_attach+0x1cd/0x2c0 [<ffffffff81ca7d43>] device_initial_probe+0x13/0x20 [<ffffffff81ca451f>] bus_probe_device+0x1af/0x250 [<ffffffff81c9e0f3>] device_add+0x943/0x13b0 [<ffffffff81c9eb7a>] device_register+0x1a/0x20 [<ffffffff81de8626>] i2c_new_device+0x5d6/0x8f0 [<ffffffffa0d88ea4>] v4l2_i2c_new_subdev_board+0x1e4/0x250 [v4l2_common] [<ffffffffa0d88fe7>] v4l2_i2c_new_subdev+0xd7/0x110 [v4l2_common] [<ffffffffa13b2f76>] au0828_card_analog_fe_setup+0x2e6/0x3f0 [au0828] Checking where the error happens: (gdb) list *au8522_probe+0x19a 0x99a is in au8522_probe (drivers/media/dvb-frontends/au8522_decoder.c:761). 756 printk(KERN_INFO "au8522_decoder attach existing instance.\n"); 757 break; 758 } 759 760 demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL); 761 if (demod_config == NULL) { 762 if (instance == 1) 763 kfree(state); 764 return -ENOMEM; 765 } Shows that the error path is not being handled properly. The are actually several issues here: 1) config free should have been calling hybrid_tuner_release_state() function, by calling au8522_release_state(); 2) config is only allocated at the digital part. On the analog one, it is received from the caller. A complex logic could be added to address it, however, it is simpler to just embeed config inside the state. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-08-11[media] dvb-frontends: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-06-19[media] au0828/au8522: Add PAL-M supportMauro Carvalho Chehab1-6/+34
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-19[media] au8522: Fix demod analog mode settingMauro Carvalho Chehab1-6/+4
There are several issues on the current code: 1) msleep(1) is actually equivalent to msleep(10); 2) au8522_video_set() will set reg 0xa4 to the proper value for SIF, CVBS or S-Video. No need to force it to CVBS; 3) Let's not hardcode 0x9d for CBS on audio_set. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-19[media] au8522: cleanup s-video settings at setup_decoder_defaults()Mauro Carvalho Chehab1-13/+8
setup_decoder_defaults() doesn't really care about the input port. All it needs to know is if the input port is s-video or not. As the caller function already knows that, just pass a boolean instead. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-19[media] au8522: be sure that we'll setup audio routing at the right timeMauro Carvalho Chehab1-4/+12
Let's set the the audio routing also at stream start. With this change, we don't risk enabling the analog demux while not streaming, reducing the risk of interfering with a DVB demux that might be happening. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-19[media] au8522: be sure that the setup will happen at streamon timeMauro Carvalho Chehab1-44/+36
The same demod is used on both analog and digital mode. We should not let the commands for analog mode to happen while the device is in digital mode. So, monitor it via streamon. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-19[media] au8522: move input_mode out one levelMauro Carvalho Chehab1-26/+67
The input mode is used not only inside the setup_decoder_defaults() but also at au8522_*_mode routines. So, move it one level up. As an advantage, we can now group the function that sets the input into just one. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-17[media] au8522_decoder: remove g_chip_ident opHans Verkuil1-17/+0
This is no longer needed since the core now handles this through DBG_G_CHIP_INFO. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-27[media] media: dvb-frontends: remove duplicate checks for EPERM in dbg_g/s_registerLad, Prabhakar1-4/+0
This patch removes check for EPERM in dbg_g/s_register as this check is already performed by core. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] au8522_decoder: remove obsolete control opsHans Verkuil1-7/+0
Now that au0828 has been converted to the control framework these compatilibity ops are no longer needed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] au8522_decoder: convert to the control frameworkHans Verkuil1-86/+44
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: add const to argument of write-only s_register ioctlHans Verkuil1-1/+1
This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] move the dvb/frontends to drivers/media/dvb-frontendsMauro Carvalho Chehab1-0/+839
Raise the DVB frontends one level up, as the intention is to remove the drivers/media/dvb directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>