[Q] vb2 userptr: struct vb2_ops::buf_cleanup() is called without buf_init()
Hi A recent report http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/47594 has revealed the following asymmetry in how videobuf2 functions: as is also documented in videobuf2-core.h, the user's struct vb2_ops::buf_init() method in the MMAP case is called after allocating the respective buffer, which happens at REQBUFS time, in the USERPTR case it is called after acquiring a new buffer at QBUF time. If the allocation in MMAP case fails, the respective buffer simply doesn't get created. However, if acquiring a new USERPTR buffer at QBUF time fails, the buffer object remains on the queue, but the user-provided .buf_init() method is not called for it. When the queue is destroyed, the user's .buf_cleanup() method is called on an uninitialised buffer. This is exactly the reason for the BUG() in the above referenced report. Therefore my question: is this videobuf2-core behaviour really correct and we should be prepared in .buf_cleanup() to process uninitialised buffers, or should the videobuf2-core be adjusted? Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 06/10] video/uvc: use memweight()
2012/5/21 Laurent Pinchart laurent.pinch...@ideasonboard.com: Hi Akinobu, Thank you for the patch. On Sunday 20 May 2012 22:23:19 Akinobu Mita wrote: Use memweight() to count the total number of bits set in memory area. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Cc: linux-media@vger.kernel.org Laurent Pinchart laurent.pinch...@ideasonboard.com You meant Acked-by, didn't you? -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 06/10] video/uvc: use memweight()
Hi Akinobu, On Monday 21 May 2012 21:03:10 Akinobu Mita wrote: 2012/5/21 Laurent Pinchart laurent.pinch...@ideasonboard.com: Hi Akinobu, Thank you for the patch. On Sunday 20 May 2012 22:23:19 Akinobu Mita wrote: Use memweight() to count the total number of bits set in memory area. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Cc: linux-media@vger.kernel.org Laurent Pinchart laurent.pinch...@ideasonboard.com You meant Acked-by, didn't you? Oops, yes, sorry. Bad copy paste. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] media_build: disable VIDEO_SMIAPP_PLL, VIDEO_MT9M032 and VIDEO_MT9P031 on old kernels
VIDEO_SMIAPP_PLL can't build on vanilla kernels older than 2.6.34 as it requires linux/lcm.h; this is not a problem with the Ubuntu 10.04 2.6.32 kernel as it includes the new lcm.* lib/header files, so the issue was not detected before. This fixes the error: media_build/v4l/smiapp-pll.c:26:23: fatal error: linux/lcm.h: No such file or directory Also, this patch explicitly disables the MT9M032 and MT9P031 drivers that depends on APTINA_PLL; this drivers try to autoselect the APTINA_PLL dependency and so they are not enabled by default on old kernels (where this driver is already blacklisted) but are still manually selectable by the user through 'make menuconfig' or 'make xconfig', breaking compilation. So it's better to explicitly blacklist this drivers too. Signed-off-by: Gianluca Gennari gennar...@gmail.com --- v4l/versions.txt |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/v4l/versions.txt b/v4l/versions.txt index a8170c2..d0626e8 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -43,7 +43,13 @@ VIDEO_TVP7002 VIDEO_DT3155 # Needs include/linux/lcm.h VIDEO_APTINA_PLL -# Requires gpio_request_one introduced in 2.6.34 +# Depends on VIDEO_APTINA_PLL +VIDEO_MT9M032 +# Depends on VIDEO_APTINA_PLL and requires gpio_request_one +VIDEO_MT9P031 +# Needs include/linux/lcm.h +VIDEO_SMIAPP_PLL +# Depends on VIDEO_SMIAPP_PLL and requires gpio_request_one VIDEO_SMIAPP [2.6.33] -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Firmware blob in vs6624 driver
The array vs6624_p1 is a list of bytes to write to the VS6624's microcontroller registers/memory, written before it starts running code: vs6624_writeregs(sd, vs6624_p1); vs6624_write(sd, VS6624_MICRO_EN, 0x2); vs6624_write(sd, VS6624_DIO_EN, 0x1); mdelay(10); This doesn't touch any of the documented registers, so presumably it's a patch to the firmware loaded from non-volatile memory. Unless you can provide source code for the patch, this should go in the linux-firmware repository and be loaded with request_firmware() instead of embedded in the GPL driver source. Also, shouldn't you check the loaded firmware version first to verify that it's safe to apply the patch? Ben. -- Ben Hutchings You can't have everything. Where would you put it? signature.asc Description: This is a digitally signed message part
re: [media] DVB: add support for the LG2160 ATSC-MH demodulator
Hi Michael, I have a question about e26f2ae4527b: [media] DVB: add support for the LG2160 ATSC-MH demodulator from Jan 29, 2012. 122 static int lg216x_write_regs(struct lg216x_state *state, 123 struct lg216x_reg *regs, int len) 124 { 125 int i, ret; 126 127 lg_reg(writing %d registers...\n, len); 128 129 for (i = 0; i len - 1; i++) { ^^^ Shouldn't this just be i len? Why do we skip the last element in the array? 130 ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); 131 if (lg_fail(ret)) 132 return ret; 133 } 134 return 0; 135 } This function is called like: ret = lg216x_write_regs(state, lg2160_init, ARRAY_SIZE(lg2160_init)); The last element of the lg2160_init[] array looks useful. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] scatterlist: add sg_alloc_table_from_pages function
Hi Andrew, Thank you for your review, Please refer to the comments below. On 05/18/2012 01:56 AM, Andrew Morton wrote: On Tue, 08 May 2012 11:50:33 +0200 Tomasz Stanislawski t.stanisl...@samsung.com wrote: This patch adds a new constructor for an sg table. The table is constructed from an array of struct pages. All contiguous chunks of the pages are merged into a single sg nodes. A user may provide an offset and a size of a buffer if the buffer is not page-aligned. The function is dedicated for DMABUF exporters which often perform conversion from an page array to a scatterlist. Moreover the scatterlist should be squashed in order to save memory and to speed-up the process of DMA mapping using dma_map_sg. The code is based on the patch 'v4l: vb2-dma-contig: add support for scatterlist in userptr mode' and hints from Laurent Pinchart. ... /** + * sg_alloc_table_from_pages - Allocate and initialize an sg table from + * an array of pages + * @sgt:The sg table header to use + * @pages: Pointer to an array of page pointers + * @n_pages:Number of pages in the pages array + * @offset: Offset from start of the first page to the start of a buffer + * @size: Number of valid bytes in the buffer (after offset) + * @gfp_mask: GFP allocation mask + * + * Description: + *Allocate and initialize an sg table from a list of pages. Continuous s/Continuous/Contiguous/ Ok. Thanks for noticing it. + *ranges of the pages are squashed into a single scatterlist node. A user + *may provide an offset at a start and a size of valid data in a buffer + *specified by the page array. The returned sg table is released by + *sg_free_table. + * + * Returns: + * 0 on success, negative error on failure + **/ nit: Use */, not **/ here. ok +int sg_alloc_table_from_pages(struct sg_table *sgt, +struct page **pages, unsigned int n_pages, +unsigned long offset, unsigned long size, +gfp_t gfp_mask) I guess a 32-bit n_pages is OK. A 16TB IO seems enough ;) Do you think that 'unsigned long' for offset is too big? Ad n_pages. Assuming that Moore's law holds it will take circa 25 years before the limit of 16 TB is reached :) for high-end scatterlist operations. Or I can change the type of n_pages to 'unsigned long' now at no cost :). +{ +unsigned int chunks; +unsigned int i; erk, please choose a different name for this. When a C programmer sees i, he very much assumes it has type int. Making it unsigned causes surprise. And don't rename it to u! Let's give it a nice meaningful name. pageno? The problem is that 'i' is a natural name for a loop counter. This exactly how 'i' is used in this function. The type 'int' was used in the initial version of the code. It was changed to avoid 'unsigned vs signed' comparisons in the loop condition. AFAIK, in the kernel code developers try to avoid Hungarian notation. A name of a variable should reflect its purpose, not its type. I can change the name of 'i' to 'pageno' and 'j' to 'pageno2' (?) but I think it will make the code less reliable. +unsigned int cur_page; +int ret; +struct scatterlist *s; + +/* compute number of contiguous chunks */ +chunks = 1; +for (i = 1; i n_pages; ++i) +if (page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1) This assumes that if two pages have contiguous pfn's then they are physically contiguous. Is that true for all architectures and memory models, including sparsemem? See sparse_encode_mem_map(). This is a very good questions. I did some research and I had looked for all pfn_to_phys implementations in the kernel code. I found that all conversions are performed by bit shifting. Therefore I expect that assumption that contiguous PFNs imply contiguous physical addresses is true for all architectures supported by Linux kernel. +++chunks; + +ret = sg_alloc_table(sgt, chunks, gfp_mask); +if (unlikely(ret)) +return ret; + +/* merging chunks and putting them into the scatterlist */ +cur_page = 0; +for_each_sg(sgt-sgl, s, sgt-orig_nents, i) { +unsigned long chunk_size; +unsigned int j; j is an int, too. Please refer to 'i'-arguments above. + +/* looking for the end of the current chunk */ s/looking/look/ ok +for (j = cur_page + 1; j n_pages; ++j) +if (page_to_pfn(pages[j]) != +page_to_pfn(pages[j - 1]) + 1) +break; + +chunk_size = ((j - cur_page) PAGE_SHIFT) - offset; +sg_set_page(s, pages[cur_page], min(size, chunk_size), offset); +size -= chunk_size; +offset = 0; +cur_page = j; +} + +return 0; +} +EXPORT_SYMBOL(sg_alloc_table_from_pages); Regards, Tomasz
re: [media] v4l/dvb: fix compiler warnings
Hello Hans Verkuil, The patch fdf07b027b2d: [media] v4l/dvb: fix compiler warnings from Apr 20, 2012, leads to the following GCC warning: warning: value computed is not used [-Wunused-value] The point of the patch was to get rid of a set but not used warning which is turned off by default because there are too many of them and they are mostly useless. And instead we got this warning which is turned on by default and usually indicates a nasty bug... Grrr... :P regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] fc001x: tuner driver for FC0012, version 0.5
Em 21-05-2012 00:16, Antti Palosaari escreveu: ma 21.5.2012 5:25 Mauro Carvalho Chehab kirjoitti: Em 20-05-2012 13:56, Antti Palosaari escreveu: Hmm, Mauro just merged those FC0012 and FC0013 drivers via my RTL2831U tree... It was not my meaning to do that like this. This was due to a pull request that you sent me on May, 18, requesting to pull from: git://linuxtv.org/anttip/media_tree.git rtl2831u http://www.spinics.net/lists/linux-media/msg47992.html I asked to pull last 6 patches. There was few other patches bottom of that due to fact it is always some extra work to jump from tree to other, sync and resolve compilation issues. Those tuner patches were there because I tested and reviewed rtl2832 driver multiple times and tuners were needed for the rtl2832. Please, don't apply patches you don't intend to go upstream on a branch that you request me to pull. As I said several times, my import scripts won't check if the patches match the diffstat of the pull request. I may eventually add such check on day, but, in that case, what I would do is to simply reject pull requests with wrong diffstats, as other any logic would be too complex to implement, as a pull request doesn't contain changeset hashes, and sometimes the same patch name might be used on two separate changesets (this is a bad practice, but I've seen it some times). With regard to the merged patches, if they are really broken, please submit me a patch removing them. Regards, Mauro -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC Patch] omap3isp : support CFA pattern when not GRBG
Hi, omap3 ISP previewer block can convert a raw bayer image into a UYVY image. Debayering coefficient are stored in an undocumented table. In the current form, only GRBG format are converted correctly. However, the other CFA arrangement can be transformed in GRBG arrangement by shifting the image window one pixel to the left or to the bottom. Here is a patch against vanilla 3.2.17. If such a patch can find it's way into mainline, I will try to port it against a suitable git tree. This was only tested with a BGGR arrangement. Thank you, Jean-Philippe François isppreview_bayer.patch Description: Binary data
Re: [media] DVB: add support for the LG2160 ATSC-MH demodulator
On Mon, May 21, 2012 at 9:58 AM, Dan Carpenter dan.carpen...@oracle.com wrote: Hi Michael, I have a question about e26f2ae4527b: [media] DVB: add support for the LG2160 ATSC-MH demodulator from Jan 29, 2012. 122 static int lg216x_write_regs(struct lg216x_state *state, 123 struct lg216x_reg *regs, int len) 124 { 125 int i, ret; 126 127 lg_reg(writing %d registers...\n, len); 128 129 for (i = 0; i len - 1; i++) { ^^^ Shouldn't this just be i len? Why do we skip the last element in the array? 130 ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); 131 if (lg_fail(ret)) 132 return ret; 133 } 134 return 0; 135 } This function is called like: ret = lg216x_write_regs(state, lg2160_init, ARRAY_SIZE(lg2160_init)); The last element of the lg2160_init[] array looks useful. You're right, Dan - that's a bug -- thanks! I'll queue up a fix for this. Best Regards, Mike Krufky -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] lg2160: fix off-by-one error in lg216x_write_regs
Fix an off-by-one error in lg216x_write_regs, causing the last element of the lg216x init block to be ignored. Spotted by Dan Carpenteter. Thanks-to: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Michael Krufky mkru...@linuxtv.org --- drivers/media/dvb/frontends/lg2160.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5..cc11260 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, lg_reg(writing %d registers...\n, len); - for (i = 0; i len - 1; i++) { + for (i = 0; i len; i++) { ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); if (lg_fail(ret)) return ret; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] lg2160: fix off-by-one error in lg216x_write_regs
eeek! spelling error in dan's name! my apologies. I will correct this in my tree before I ask Mauro to merge it. -Mike On Mon, May 21, 2012 at 11:34 AM, Michael Krufky mkru...@kernellabs.com wrote: Fix an off-by-one error in lg216x_write_regs, causing the last element of the lg216x init block to be ignored. Spotted by Dan Carpenteter. Thanks-to: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Michael Krufky mkru...@linuxtv.org --- drivers/media/dvb/frontends/lg2160.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5..cc11260 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, lg_reg(writing %d registers...\n, len); - for (i = 0; i len - 1; i++) { + for (i = 0; i len; i++) { ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); if (lg_fail(ret)) return ret; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] lg2160: fix off-by-one error in lg216x_write_regs
On Mon, May 21, 2012 at 11:58:06AM -0400, Michael Krufky wrote: eeek! spelling error in dan's name! my apologies. I will correct this in my tree before I ask Mauro to merge it. Hehe. Also since you're redoing it, could you change the Thanks-to: to Reported-by:? regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] lg2160: fix off-by-one error in lg216x_write_regs
Fix an off-by-one error in lg216x_write_regs, causing the last element of the lg216x init block to be ignored. Spotted by Dan Carpenter. Reported-by: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Michael Krufky mkru...@linuxtv.org --- drivers/media/dvb/frontends/lg2160.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5..cc11260 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, lg_reg(writing %d registers...\n, len); - for (i = 0; i len - 1; i++) { + for (i = 0; i len; i++) { ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); if (lg_fail(ret)) return ret; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] fc001x: tuner driver for FC0012, version 0.5
ma 21.5.2012 17:29 Mauro Carvalho Chehab kirjoitti: Em 21-05-2012 00:16, Antti Palosaari escreveu: ma 21.5.2012 5:25 Mauro Carvalho Chehab kirjoitti: Em 20-05-2012 13:56, Antti Palosaari escreveu: Hmm, Mauro just merged those FC0012 and FC0013 drivers via my RTL2831U tree... It was not my meaning to do that like this. This was due to a pull request that you sent me on May, 18, requesting to pull from: git://linuxtv.org/anttip/media_tree.git rtl2831u http://www.spinics.net/lists/linux-media/msg47992.html I asked to pull last 6 patches. There was few other patches bottom of that due to fact it is always some extra work to jump from tree to other, sync and resolve compilation issues. Those tuner patches were there because I tested and reviewed rtl2832 driver multiple times and tuners were needed for the rtl2832. Please, don't apply patches you don't intend to go upstream on a branch that you request me to pull. As I said several times, my import scripts won't check if the patches match the diffstat of the pull request. I may eventually add such check on day, but, in that case, what I would do is to simply reject pull requests with wrong diffstats, as other any logic would be too complex to implement, as a pull request doesn't contain changeset hashes, and sometimes the same patch name might be used on two separate changesets (this is a bad practice, but I've seen it some times). With regard to the merged patches, if they are really broken, please submit me a patch removing them. They are not broken mean of broken. Let those be as it is now and apply fixes top of that. regards Antti -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] fc001x: tuner driver for FC0012, version 0.5
Em 21-05-2012 13:14, Antti Palosaari escreveu: With regard to the merged patches, if they are really broken, please submit me a patch removing them. They are not broken mean of broken. Let those be as it is now and apply fixes top of that. OK. regards Antti -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V7 0/5] [Media] Radio: Fixes and New features for FM
From: Manjunatha Halli x0130...@ti.com Mauro and the list, This version 7 of patchset resolves the comments received from Han's on patchset v6. Also removed the frequency band handling from this patch set. This patchset creates new control class 'V4L2_CTRL_CLASS_FM_RX' for FM RX, introduces 2 new CID's for FM RX and and 1 new CID for FM TX. Also adds 1 field in struct v4l2_hw_freq_seek. This patch adds few new features to TI's FM driver features are listed below, 1) FM TX RDS Support (RT, PS, AF, PI, PTY) 2) FM RX Russian band support 3) FM RX AF set/get 4) FM RX De-emphasis mode set/get Along with new features this patch also fixes few issues in the driver like default rssi level for seek, unnecessory logs etc. Manjunatha Halli (5): WL128x: Add support for FM TX RDS New control class and features for FM RX Add new CID for FM TX RDS Alternate Frequency Media: Update docs for V4L2 FM new features WL12xx: Add support for FM new features Documentation/DocBook/media/v4l/compat.xml |3 + Documentation/DocBook/media/v4l/controls.xml | 77 Documentation/DocBook/media/v4l/dev-rds.xml|5 +- .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml |7 ++ drivers/media/radio/wl128x/fmdrv.h |2 +- drivers/media/radio/wl128x/fmdrv_common.c | 30 +--- drivers/media/radio/wl128x/fmdrv_common.h | 25 +-- drivers/media/radio/wl128x/fmdrv_rx.c | 13 +++- drivers/media/radio/wl128x/fmdrv_tx.c | 41 +-- drivers/media/radio/wl128x/fmdrv_tx.h |3 +- drivers/media/radio/wl128x/fmdrv_v4l2.c| 74 +++ drivers/media/video/v4l2-ctrls.c | 18 - include/linux/videodev2.h | 10 +++ 13 files changed, 255 insertions(+), 53 deletions(-) -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V7 1/5] WL128x: Add support for FM TX RDS
From: Manjunatha Halli x0130...@ti.com This patch adds support for following FM TX RDS features, 1. Radio Text 2. PS Name 3. PI Code 4. PTY Code. Along with above this patch fixes few other minor issues(like fm tx get frequency, unnecessary error messages etc). Acked-by: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Manjunatha Halli x0130...@ti.com --- drivers/media/radio/wl128x/fmdrv_common.c | 17 +++--- drivers/media/radio/wl128x/fmdrv_common.h | 17 +++ drivers/media/radio/wl128x/fmdrv_rx.c |2 +- drivers/media/radio/wl128x/fmdrv_tx.c | 41 ++--- drivers/media/radio/wl128x/fmdrv_tx.h |3 +- drivers/media/radio/wl128x/fmdrv_v4l2.c | 47 + 6 files changed, 90 insertions(+), 37 deletions(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c index bf867a6..fcce61a 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.c +++ b/drivers/media/radio/wl128x/fmdrv_common.c @@ -354,7 +354,7 @@ static void send_tasklet(unsigned long arg) /* Check, is there any timeout happened to last transmitted packet */ if ((jiffies - fmdev-last_tx_jiffies) FM_DRV_TX_TIMEOUT) { - fmerr(TX timeout occurred\n); + fmdbg(TX timeout occurred\n); atomic_set(fmdev-tx_cnt, 1); } @@ -615,7 +615,11 @@ static void fm_irq_handle_rds_start(struct fmdev *fmdev) { if (fmdev-irq_info.flag FM_RDS_EVENT fmdev-irq_info.mask) { fmdbg(irq: rds threshold reached\n); - fmdev-irq_info.stage = FM_RDS_SEND_RDS_GETCMD_IDX; + /* If RSSI reached below threshold then dont get RDS data */ + if (fmdev-irq_info.flag FM_LEV_EVENT) + fmdev-irq_info.stage = FM_HW_TUNE_OP_ENDED_IDX; + else + fmdev-irq_info.stage = FM_RDS_SEND_RDS_GETCMD_IDX; } else { /* Continue next function in interrupt handler table */ fmdev-irq_info.stage = FM_HW_TUNE_OP_ENDED_IDX; @@ -1129,8 +1133,9 @@ int fmc_set_freq(struct fmdev *fmdev, u32 freq_to_set) int fmc_get_freq(struct fmdev *fmdev, u32 *cur_tuned_frq) { - if (fmdev-rx.freq == FM_UNDEFINED_FREQ) { - fmerr(RX frequency is not set\n); + if (fmdev-rx.freq == FM_UNDEFINED_FREQ + fmdev-tx_data.tx_frq == FM_UNDEFINED_FREQ) { + fmerr(RX/TX frequency is not set\n); return -EPERM; } if (cur_tuned_frq == NULL) { @@ -1144,7 +1149,7 @@ int fmc_get_freq(struct fmdev *fmdev, u32 *cur_tuned_frq) return 0; case FM_MODE_TX: - *cur_tuned_frq = 0; /* TODO : Change this later */ + *cur_tuned_frq = fmdev-tx_data.tx_frq; return 0; default: @@ -1574,6 +1579,8 @@ int fmc_prepare(struct fmdev *fmdev) fmdev-rx.af_mode = FM_RX_RDS_AF_SWITCH_MODE_OFF; fmdev-irq_info.retry = 0; + fmdev-tx_data.tx_frq = FM_UNDEFINED_FREQ; + fm_rx_reset_rds_cache(fmdev); init_waitqueue_head(fmdev-rx.rds.read_queue); diff --git a/drivers/media/radio/wl128x/fmdrv_common.h b/drivers/media/radio/wl128x/fmdrv_common.h index d9b9c6c..196ff7d 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.h +++ b/drivers/media/radio/wl128x/fmdrv_common.h @@ -48,8 +48,8 @@ struct fm_reg_table { #define SEARCH_LVL_SET 15 #define BAND_SET 16 #define MUTE_STATUS_SET 17 -#define RDS_PAUSE_LVL_SET18 -#define RDS_PAUSE_DUR_SET19 +#define AUD_PAUSE_LVL_SET18 +#define AUD_PAUSE_DUR_SET19 #define RDS_MEM_SET 20 #define RDS_BLK_B_SET21 #define RDS_MSK_B_SET22 @@ -84,11 +84,12 @@ struct fm_reg_table { #define FM_POWER_MODE254 #define FM_INTERRUPT 255 +#define STATION_VALID 123 /* Transmitter API */ #define CHANL_SET55 -#define CHANL_BW_SET 56 +#define SCAN_SPACING_SET 56 #define REF_SET 57 #define POWER_ENB_SET90 #define POWER_ATT_SET58 @@ -103,7 +104,8 @@ struct fm_reg_table { #define MONO_SET 66 #define MUTE 92 #define MPX_LMT_ENABLE 67 -#define PI_SET 93 +#define REF_ERR_SET 93 +#define PI_SET 68 #define ECC_SET 69 #define PTY 70 #define AF 71 @@ -120,6 +122,10 @@ struct fm_reg_table { #define TX_AUDIO_LEVEL_TEST 96 #define TX_AUDIO_LEVEL_TEST_THRESHOLD73 #define TX_AUDIO_INPUT_LEVEL_RANGE_SET 54 +#define TX_AUDIO_LEVEL_GET 7 +#define READ_FMANT_TUNE_VALUE104 + +/* New FM APIs (Rx and Tx) */ #define RX_ANTENNA_SELECT87 #define I2C_DEV_ADDR_SET
[PATCH V7 4/5] Media: Update docs for V4L2 FM new features
From: Manjunatha Halli x0130...@ti.com The list of new features - 1) New control class for FM RX 2) New FM RX CID's - De-Emphasis filter mode and RDS AF switch 3) New FM TX CID - RDS Alternate frequency set. Acked-by: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Manjunatha Halli x0130...@ti.com --- Documentation/DocBook/media/v4l/compat.xml |3 + Documentation/DocBook/media/v4l/controls.xml | 77 Documentation/DocBook/media/v4l/dev-rds.xml|5 +- .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml |7 ++ 4 files changed, 90 insertions(+), 2 deletions(-) diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index bce97c5..df1f345 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml @@ -2311,6 +2311,9 @@ more information./para paraAdded FM Modulator (FM TX) Extended Control Class: constantV4L2_CTRL_CLASS_FM_TX/constant and their Control IDs./para /listitem listitem + paraAdded FM Receiver (FM RX) Extended Control Class: constantV4L2_CTRL_CLASS_FM_RX/constant and their Control IDs./para + /listitem + listitem paraAdded Remote Controller chapter, describing the default Remote Controller mapping for media devices./para /listitem /orderedlist diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index b84f25e..ced2bee 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -3018,6 +3018,12 @@ to find receivers which can scroll strings sized as 32 x N or 64 x N characters. with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. /entry /row row + entry spanname=idconstantV4L2_CID_RDS_TX_AF_FREQ/constantnbsp;/entry + entryinteger/entry + /row + rowentry spanname=descrSets the RDS Alternate Frequency value which allows a receiver to re-tune to a different frequency providing the same station when the first signal becomes too weak (e.g., when moving out of range). /entry + /row + row entry spanname=idconstantV4L2_CID_AUDIO_LIMITER_ENABLED/constantnbsp;/entry entryboolean/entry /row @@ -3146,6 +3152,77 @@ manually or automatically if set to zero. Unit, range and step are driver-specif xref linkend=en50067 / document, from CENELEC./para /section +section id=fm-rx-controls + titleFM Receiver Control Reference/title + + paraThe FM Receiver (FM_RX) class includes controls for common features of +FM Reception capable devices./para + + table pgwide=1 frame=none id=fm-rx-control-id + titleFM_RX Control IDs/title + + tgroup cols=4 +colspec colname=c1 colwidth=1* / +colspec colname=c2 colwidth=6* / +colspec colname=c3 colwidth=2* / +colspec colname=c4 colwidth=6* / +spanspec namest=c1 nameend=c2 spanname=id / +spanspec namest=c2 nameend=c4 spanname=descr / +thead + row +entry spanname=id align=leftID/entry +entry align=leftType/entry + /rowrow rowsep=1entry spanname=descr align=leftDescription/entry + /row +/thead +tbody valign=top + rowentry/entry/row + row +entry spanname=idconstantV4L2_CID_FM_RX_CLASS/constantnbsp;/entry +entryclass/entry + /rowrowentry spanname=descrThe FM_RX class +descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a +description of this control class./entry + /row + row +entry spanname=idconstantV4L2_CID_RDS_AF_SWITCH/constantnbsp;/entry +entryboolean/entry + /row + rowentry spanname=descrEnable or Disable the RDS Alternate frequency feature. When enabled the driver will decode the RDS AF field and tries to switch to this AF frequency once the current frequency RSSI (Received signal strength indication) level goes below the threshold. If the frequency is switched, then VIDIOC-G-FREQUENCY; will return the new frequency./entry + /row + row + entry spanname=idconstantV4L2_CID_TUNE_DEEMPHASIS/constantnbsp;/entry + entryinteger/entry + /row + row id=v4l2-deemphasisentry spanname=descrConfigures the de-emphasis value for reception. +A pre-emphasis filter is applied to the broadcast to accentuate the high audio frequencies. +Depending on the region, a time constant of either 50 or 75 useconds is used. The enumnbsp;v4l2_preemphasis +defines possible values for pre-emphasis. Here they are:/entry + /rowrow + entrytbl spanname=descr cols=2 + tbody valign=top + row +
[PATCH V7 5/5] WL12xx: Add support for FM new features
From: Manjunatha Halli x0130...@ti.com This patch adds below features to TI's V4l2 FM driver for Wilink chipsets, 1) FM RX RDS AF turn ON/OFF 2) FM RX De-Emphasis mode set/get 3) FM TX Alternate Frequency set/get Also this patch fixes below issues 1) FM audio volume gain setting 2) Default rssi level is set to 8 instead of 20 3) Enable FM RX AF support in driver 4) In wrap_around seek mode try for once Acked-by: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Manjunatha Halli x0130...@ti.com --- drivers/media/radio/wl128x/fmdrv.h|2 +- drivers/media/radio/wl128x/fmdrv_common.c | 13 +++-- drivers/media/radio/wl128x/fmdrv_common.h | 10 +++--- drivers/media/radio/wl128x/fmdrv_rx.c | 11 +-- drivers/media/radio/wl128x/fmdrv_v4l2.c | 27 +++ 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/drivers/media/radio/wl128x/fmdrv.h b/drivers/media/radio/wl128x/fmdrv.h index d84ad9d..e1a3c78 100644 --- a/drivers/media/radio/wl128x/fmdrv.h +++ b/drivers/media/radio/wl128x/fmdrv.h @@ -203,7 +203,7 @@ struct fmtx_data { struct fmdev { struct video_device *radio_dev; /* V4L2 video device pointer */ struct snd_card *card; /* Card which holds FM mixer controls */ - u16 asci_id; + u16 asic_id; spinlock_t rds_buff_lock; /* To protect access to RDS buffer */ spinlock_t resp_skb_lock; /* To protect access to received SKB */ diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c index fcce61a..9ab7a63 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.c +++ b/drivers/media/radio/wl128x/fmdrv_common.c @@ -596,7 +596,6 @@ static void fm_irq_handle_flag_getcmd_resp(struct fmdev *fmdev) memcpy(fmdev-irq_info.flag, skb-data, fm_evt_hdr-dlen); fmdev-irq_info.flag = be16_to_cpu(fmdev-irq_info.flag); - fmdbg(irq: flag register(0x%x)\n, fmdev-irq_info.flag); /* Continue next function in interrupt handler table */ fm_irq_call_stage(fmdev, FM_HW_MAL_FUNC_IDX); @@ -702,7 +701,7 @@ static void fm_rdsparse_swapbytes(struct fmdev *fmdev, * in Dolphin they are in big endian, the parsing of the RDS data * is chip dependent */ - if (fmdev-asci_id != 0x6350) { + if (fmdev-asic_id != 0x6350) { rds_buff = rds_format-data.groupdatabuff.buff[0]; while (index + 1 FM_RX_RDS_INFO_FIELD_MAX) { byte1 = rds_buff[index]; @@ -1353,11 +1352,13 @@ static int fm_power_up(struct fmdev *fmdev, u8 mode) sizeof(asic_ver), asic_ver, resp_len)) goto rel; + fmdev-asic_id = be16_to_cpu(asic_id); + fmdbg(ASIC ID: 0x%x , ASIC Version: %d\n, - be16_to_cpu(asic_id), be16_to_cpu(asic_ver)); + fmdev-asic_id, be16_to_cpu(asic_ver)); sprintf(fw_name, %s_%x.%d.bts, FM_FMC_FW_FILE_START, - be16_to_cpu(asic_id), be16_to_cpu(asic_ver)); + fmdev-asic_id, be16_to_cpu(asic_ver)); ret = fm_download_firmware(fmdev, fw_name); if (ret 0) { @@ -1366,7 +1367,7 @@ static int fm_power_up(struct fmdev *fmdev, u8 mode) } sprintf(fw_name, %s_%x.%d.bts, (mode == FM_MODE_RX) ? FM_RX_FW_FILE_START : FM_TX_FW_FILE_START, - be16_to_cpu(asic_id), be16_to_cpu(asic_ver)); + fmdev-asic_id, be16_to_cpu(asic_ver)); ret = fm_download_firmware(fmdev, fw_name); if (ret 0) { @@ -1576,7 +1577,7 @@ int fmc_prepare(struct fmdev *fmdev) fmdev-rx.rds.flag = FM_RDS_DISABLE; fmdev-rx.freq = FM_UNDEFINED_FREQ; fmdev-rx.rds_mode = FM_RDS_SYSTEM_RDS; - fmdev-rx.af_mode = FM_RX_RDS_AF_SWITCH_MODE_OFF; + fmdev-rx.af_mode = FM_RX_RDS_AF_SWITCH_MODE_ON; fmdev-irq_info.retry = 0; fmdev-tx_data.tx_frq = FM_UNDEFINED_FREQ; diff --git a/drivers/media/radio/wl128x/fmdrv_common.h b/drivers/media/radio/wl128x/fmdrv_common.h index 196ff7d..a57c662 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.h +++ b/drivers/media/radio/wl128x/fmdrv_common.h @@ -201,8 +201,8 @@ struct fm_event_msg_hdr { #define FM_UNDEFINED_FREQ 0x /* Band types */ -#define FM_BAND_EUROPE_US 0 -#define FM_BAND_JAPAN 1 +#define FM_BAND_EUROPE_US 0 +#define FM_BAND_JAPAN 1 /* Seek directions */ #define FM_SEARCH_DIRECTION_DOWN 0 @@ -213,6 +213,10 @@ struct fm_event_msg_hdr { #define FM_TUNER_PRESET_MODE 1 #define FM_TUNER_AUTONOMOUS_SEARCH_MODE2 #define FM_TUNER_AF_JUMP_MODE 3 +#define FM_TUNER_PI_MATCH_MODE 4 +#define FM_TUNER_BULK_SEARCH_MODE 5 +#define FM_TUNER_WRAP_SEARCH_MODE 6 +#define FM_TUNER_WEATHER_MODE 7 /* Min and Max volume */ #define
[PATCH V7 2/5] New control class and features for FM RX
From: Manjunatha Halli x0130...@ti.com This patch creates new ctrl class for FM RX and adds new CID's for below FM features, 1) De-Emphasis filter mode 2) RDS Alternate Frequency switch Acked-by: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Manjunatha Halli x0130...@ti.com --- drivers/media/video/v4l2-ctrls.c | 17 ++--- include/linux/videodev2.h|9 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 18015c0..9d7608e 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -243,8 +243,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) Vivid, NULL }; - static const char * const tune_preemphasis[] = { - No Preemphasis, + static const char * const tune_emphasis[] = { + None, 50 Microseconds, 75 Microseconds, NULL, @@ -413,7 +413,9 @@ const char * const *v4l2_ctrl_get_menu(u32 id) case V4L2_CID_COLORFX: return colorfx; case V4L2_CID_TUNE_PREEMPHASIS: - return tune_preemphasis; + return tune_emphasis; + case V4L2_CID_TUNE_DEEMPHASIS: + return tune_emphasis; case V4L2_CID_FLASH_LED_MODE: return flash_led_mode; case V4L2_CID_FLASH_STROBE_SOURCE: @@ -644,6 +646,12 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_JPEG_COMPRESSION_QUALITY: return Compression Quality; case V4L2_CID_JPEG_ACTIVE_MARKER: return Active Markers; + /* FM Radio Receiver control */ + /* Keep the order of the 'case's the same as in videodev2.h! */ + case V4L2_CID_FM_RX_CLASS: return FM Radio Receiver Controls; + case V4L2_CID_RDS_AF_SWITCH:return RDS Alternate Frequency Switch; + case V4L2_CID_TUNE_DEEMPHASIS: return De-Emphasis; + default: return NULL; } @@ -688,6 +696,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM: case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE: case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL: + case V4L2_CID_RDS_AF_SWITCH: *type = V4L2_CTRL_TYPE_BOOLEAN; *min = 0; *max = *step = 1; @@ -733,6 +742,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL: case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE: case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: + case V4L2_CID_TUNE_DEEMPHASIS: *type = V4L2_CTRL_TYPE_MENU; break; case V4L2_CID_RDS_TX_PS_NAME: @@ -745,6 +755,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_FM_TX_CLASS: case V4L2_CID_FLASH_CLASS: case V4L2_CID_JPEG_CLASS: + case V4L2_CID_FM_RX_CLASS: *type = V4L2_CTRL_TYPE_CTRL_CLASS; /* You can neither read not write these */ *flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index c9c9a46..eb2da58 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1137,6 +1137,7 @@ struct v4l2_ext_controls { #define V4L2_CTRL_CLASS_FM_TX 0x009b /* FM Modulator control class */ #define V4L2_CTRL_CLASS_FLASH 0x009c /* Camera flash controls */ #define V4L2_CTRL_CLASS_JPEG 0x009d/* JPEG-compression controls */ +#define V4L2_CTRL_CLASS_FM_RX 0x009e /* FM Receiver control class */ #define V4L2_CTRL_ID_MASK(0x0fff) #define V4L2_CTRL_ID2CLASS(id)((id) 0x0fffUL) @@ -1782,6 +1783,13 @@ enum v4l2_jpeg_chroma_subsampling { #defineV4L2_JPEG_ACTIVE_MARKER_DQT (1 17) #defineV4L2_JPEG_ACTIVE_MARKER_DHT (1 18) +/* FM Receiver class control IDs */ +#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900) +#define V4L2_CID_FM_RX_CLASS (V4L2_CTRL_CLASS_FM_RX | 1) + +#define V4L2_CID_RDS_AF_SWITCH (V4L2_CID_FM_RX_CLASS_BASE + 1) +#define V4L2_CID_TUNE_DEEMPHASIS (V4L2_CID_FM_RX_CLASS_BASE + 2) + /* * T U N I N G */ @@ -1820,6 +1828,7 @@ struct v4l2_modulator { #define V4L2_TUNER_CAP_RDS_BLOCK_IO0x0100 #define V4L2_TUNER_CAP_RDS_CONTROLS0x0200 + /* Flags for the 'rxsubchans' field */ #define V4L2_TUNER_SUB_MONO0x0001 #define V4L2_TUNER_SUB_STEREO 0x0002 -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V7 3/5] Add new CID for FM TX RDS Alternate Frequency
From: Manjunatha Halli x0130...@ti.com Acked-by: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Manjunatha Halli x0130...@ti.com --- drivers/media/video/v4l2-ctrls.c |1 + include/linux/videodev2.h|1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 9d7608e..610076c 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -608,6 +608,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_RDS_TX_PTY: return RDS Program Type; case V4L2_CID_RDS_TX_PS_NAME: return RDS PS Name; case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text; + case V4L2_CID_RDS_TX_AF_FREQ: return RDS Alternate Frequency; case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature Enabled; case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release Time; case V4L2_CID_AUDIO_LIMITER_DEVIATION: return Audio Limiter Deviation; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index eb2da58..2f6e2ef 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1699,6 +1699,7 @@ enum v4l2_exposure_auto_type { #define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 3) #define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5) #define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6) +#define V4L2_CID_RDS_TX_AF_FREQ (V4L2_CID_FM_TX_CLASS_BASE + 7) #define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64) #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 65) -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V6 2/5] New control class and features for FM RX
On Sun, May 20, 2012 at 4:52 AM, Hans Verkuil hverk...@xs4all.nl wrote: On Tue May 15 2012 00:01:50 manjunatha_ha...@ti.com wrote: From: Manjunatha Halli x0130...@ti.com This patch creates new ctrl class for FM RX and adds new CID's for below FM features, 1) De-Emphasis filter mode 2) RDS Alternate Frequency switch Also this patch adds a field for band selection in struct v4l2_hw_freq_seek and adds new capability flags for all below FM bands 1) V4L2_TUNER_CAP_BAND_TYPE_DEFAULT - Default Band 2) V4L2_TUNER_CAP_BAND_TYPE_EUROPE_US - Europe/US Band 3) V4L2_TUNER_CAP_BAND_TYPE_JAPAN - Japan Band 4) V4L2_TUNER_CAP_BAND_TYPE_RUSSIAN - Russian Band 5) V4L2_TUNER_CAP_BAND_TYPE_WEATHER - Weather Band Signed-off-by: Manjunatha Halli x0130...@ti.com --- drivers/media/video/v4l2-ctrls.c | 17 ++--- include/linux/videodev2.h | 24 +++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index c9c9a46..7b3dd95 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h ... @@ -1819,6 +1827,12 @@ struct v4l2_modulator { #define V4L2_TUNER_CAP_RDS 0x0080 #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 +#define V4L2_TUNER_CAP_BAND_TYPE_DEFAULT 0x /* Default band */ +#define V4L2_TUNER_CAP_BAND_TYPE_EUROPE_US 0x0001 /* Europe/US band */ +#define V4L2_TUNER_CAP_BAND_TYPE_JAPAN 0x0002 /* Japan band */ +#define V4L2_TUNER_CAP_BAND_TYPE_RUSSIAN 0x0003 /* Russian band */ +#define V4L2_TUNER_CAP_BAND_TYPE_WEATHER 0x0004 /* Weather band */ Argh! These capabilities are wrong: these should have been 0x1, 0x2, 0x4 and 0x8! Bits that you can OR together. Also, I think _TYPE can be dropped here, just as we did for the V4L2_FM_BAND defines below. V4L2_TUNER_CAP_BAND_TYPE_DEFAULT is useless as a capability and should be dropped. Manju, I would recommend that you split off the frequency band handling from the other patches. Based on an RFC from Hans de Goede regarding work on the AM band I believe we need to postpone this part for 3.6. The other patches in this series not related to frequency bands are fine and you can keep my Acked-by there. Mauro, if you intended to merge Manjunatha's patches for 3.5, then please wait with merging them until he had a chance to split off the frequency band bits. Regards, Hans Hans, Now I have sent the patch set V7 without the frequency handling part. I will send the frequency handling patches once we come to a conclusion for AM and FM bands with Hans de Goede :) + /* Flags for the 'rxsubchans' field */ #define V4L2_TUNER_SUB_MONO 0x0001 @@ -1843,13 +1857,21 @@ struct v4l2_frequency { __u32 reserved[8]; }; + +#define V4L2_FM_BAND_DEFAULT 0 +#define V4L2_FM_BAND_EUROPE_US 1 /* 87.5 Mhz - 108 MHz */ +#define V4L2_FM_BAND_JAPAN 2 /* 76 MHz - 90 MHz */ +#define V4L2_FM_BAND_RUSSIAN 3 /* 65.8 MHz - 74 MHz */ +#define V4L2_FM_BAND_WEATHER 4 /* 162.4 MHz - 162.55 MHz */ + struct v4l2_hw_freq_seek { __u32 tuner; enum v4l2_tuner_type type; __u32 seek_upward; __u32 wrap_around; __u32 spacing; - __u32 reserved[7]; + __u32 band; + __u32 reserved[6]; }; /* -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Regards Halli -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PULL BUG-FIX] git://git.linuxtv.org/mkrufky/mxl111sf lg2160
Mauro, Please merge: The following changes since commit abed623ca59a7d1abed6c4e7459be03e25a90a1e: [media] radio-sf16fmi: add support for SF16-FMD (2012-05-20 16:10:05 -0300) are available in the git repository at: git://git.linuxtv.org/mkrufky/mxl111sf lg2160 for you to fetch changes up to 80fed89735a02dd03d682261967a246ca9b0129f: lg2160: fix off-by-one error in lg216x_write_regs (2012-05-21 12:04:05 -0400) Michael Krufky (1): lg2160: fix off-by-one error in lg216x_write_regs drivers/media/dvb/frontends/lg2160.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) On Mon, May 21, 2012 at 12:06 PM, Michael Krufky mkru...@kernellabs.com wrote: Fix an off-by-one error in lg216x_write_regs, causing the last element of the lg216x init block to be ignored. Spotted by Dan Carpenter. Reported-by: Dan Carpenter dan.carpen...@oracle.com Signed-off-by: Michael Krufky mkru...@linuxtv.org --- drivers/media/dvb/frontends/lg2160.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5..cc11260 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, lg_reg(writing %d registers...\n, len); - for (i = 0; i len - 1; i++) { + for (i = 0; i len; i++) { ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); if (lg_fail(ret)) return ret; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cron job: media_tree daily build: ERRORS
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date:Mon May 21 19:00:21 CEST 2012 git hash:abed623ca59a7d1abed6c4e7459be03e25a90a1e gcc version: i686-linux-gcc (GCC) 4.6.3 host hardware:x86_64 host os: 3.3-6.slh.2-amd64 linux-git-arm-eabi-exynos: OK linux-git-arm-eabi-omap: WARNINGS linux-git-armv5-ixp: WARNINGS linux-git-i686: WARNINGS linux-git-m32r: WARNINGS linux-git-mips: WARNINGS linux-git-powerpc64: WARNINGS linux-git-x86_64: WARNINGS linux-2.6.31.12-i686: ERRORS linux-2.6.32.6-i686: WARNINGS linux-2.6.33-i686: WARNINGS linux-2.6.34-i686: WARNINGS linux-2.6.35.3-i686: WARNINGS linux-2.6.36-i686: WARNINGS linux-2.6.37-i686: WARNINGS linux-2.6.38.2-i686: WARNINGS linux-2.6.39.1-i686: WARNINGS linux-3.0-i686: WARNINGS linux-3.1-i686: WARNINGS linux-3.2.1-i686: WARNINGS linux-3.3-i686: WARNINGS linux-2.6.31.12-x86_64: ERRORS linux-2.6.32.6-x86_64: WARNINGS linux-2.6.33-x86_64: WARNINGS linux-2.6.34-x86_64: WARNINGS linux-2.6.35.3-x86_64: WARNINGS linux-2.6.36-x86_64: WARNINGS linux-2.6.37-x86_64: WARNINGS linux-2.6.38.2-x86_64: WARNINGS linux-2.6.39.1-x86_64: WARNINGS linux-3.0-x86_64: WARNINGS linux-3.1-x86_64: WARNINGS linux-3.2.1-x86_64: WARNINGS linux-3.3-x86_64: WARNINGS apps: WARNINGS spec-git: WARNINGS sparse: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Monday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Monday.tar.bz2 The V4L-DVB specification from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] fc001x: tuner driver for FC0013
Antti, Am Sonntag, 20. Mai 2012 schrieb Antti Palosaari: On 06.05.2012 23:57, Hans-Frieder Vogt wrote: Support for tuner Fitipower FC0013 Signed-off-by: Hans-Frieder Vogthfv...@gmx.net drivers/media/common/tuners/Kconfig |7 drivers/media/common/tuners/Makefile |1 drivers/media/common/tuners/fc0013-priv.h | 44 ++ drivers/media/common/tuners/fc0013.c | 562 ++ drivers/media/common/tuners/fc0013.h | 57 +++ 5 files changed, 671 insertions(+) diff -up --new-file --recursive a/drivers/media/common/tuners/Kconfig b/drivers/media/common/tuners/Kconfig --- a/drivers/media/common/tuners/Kconfig 2012-05-06 22:20:10.167088333 +0200 +++ b/drivers/media/common/tuners/Kconfig 2012-05-05 12:00:43.769785450 +0200 @@ -218,6 +218,13 @@ config MEDIA_TUNER_FC0012 help Fitipower FC0012 silicon tuner driver. +config MEDIA_TUNER_FC0013 + tristate Fitipower FC0013 silicon tuner + depends on VIDEO_MEDIA I2C + default m if MEDIA_TUNER_CUSTOMISE + help + Fitipower FC0013 silicon tuner driver. + config MEDIA_TUNER_TDA18212 tristate NXP TDA18212 silicon tuner depends on VIDEO_MEDIA I2C diff -up --new-file --recursive a/drivers/media/common/tuners/Makefile b/drivers/media/common/tuners/Makefile --- a/drivers/media/common/tuners/Makefile 2012-05-06 22:20:25.270299615 +0200 +++ b/drivers/media/common/tuners/Makefile2012-05-06 19:13:08.974524215 +0200 @@ -31,6 +31,7 @@ obj-$(CONFIG_MEDIA_TUNER_TDA18212) += td obj-$(CONFIG_MEDIA_TUNER_TUA9001) += tua9001.o obj-$(CONFIG_MEDIA_TUNER_FC0011) += fc0011.o obj-$(CONFIG_MEDIA_TUNER_FC0012) += fc0012.o +obj-$(CONFIG_MEDIA_TUNER_FC0013) += fc0013.o ccflags-y += -I$(srctree)/drivers/media/dvb/dvb-core ccflags-y += -I$(srctree)/drivers/media/dvb/frontends diff -up --new-file --recursive a/drivers/media/common/tuners/fc0013.c b/drivers/media/common/tuners/fc0013.c --- a/drivers/media/common/tuners/fc0013.c 1970-01-01 01:00:00.0 +0100 +++ b/drivers/media/common/tuners/fc0013.c2012-05-06 19:40:15.506368324 +0200 @@ -0,0 +1,562 @@ +/* + * Fitipower FC0013 tuner driver + * + * Copyright (C) 2012 Hans-Frieder Vogthfv...@gmx.net + * partially based on driver code from Fitipower + * Copyright (C) 2010 Fitipower Integrated Technology Inc + * + *This program is free software; you can redistribute it and/or modify + *it under the terms of the GNU General Public License as published by + *the Free Software Foundation; either version 2 of the License, or + *(at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include fc0013.h +#include fc0013-priv.h + +static int fc0013_writereg(struct fc0013_priv *priv, u8 reg, u8 val) +{ + u8 buf[2] = {reg, val}; + struct i2c_msg msg = { + .addr = priv-addr, .flags = 0, .buf = buf, .len = 2 + }; + + if (i2c_transfer(priv-i2c,msg, 1) != 1) { + err(I2C write reg failed, reg: %02x, val: %02x, reg, val); + return -EREMOTEIO; + } + return 0; +} + +static int fc0013_readreg(struct fc0013_priv *priv, u8 reg, u8 *val) +{ + struct i2c_msg msg[2] = { + { .addr = priv-addr, .flags = 0, .buf =reg, .len = 1 }, + { .addr = priv-addr, .flags = I2C_M_RD, .buf = val, .len = 1 }, + }; + + if (i2c_transfer(priv-i2c, msg, 2) != 2) { + err(I2C read reg failed, reg: %02x, reg); + return -EREMOTEIO; + } + return 0; +} + +static int fc0013_release(struct dvb_frontend *fe) +{ + kfree(fe-tuner_priv); + fe-tuner_priv = NULL; + return 0; +} + +static int fc0013_init(struct dvb_frontend *fe) +{ + struct fc0013_priv *priv = fe-tuner_priv; + int i, ret = 0; + unsigned char reg[] = { + 0x00, /* reg. 0x00: dummy */ + 0x09, /* reg. 0x01 */ + 0x16, /* reg. 0x02 */ + 0x00, /* reg. 0x03 */ + 0x00, /* reg. 0x04 */ + 0x17, /* reg. 0x05 */ + 0x02, /* reg. 0x06 */ + 0x0a, /* reg. 0x07: CHECK */ + 0xff, /* reg. 0x08: AGC Clock divide by 256, AGC gain 1/256, + Loop Bw 1/8 */ + 0x6f, /* reg. 0x09: enable LoopThrough */ + 0xb8, /* reg. 0x0a: Disable LO Test
[PATCH] DVB: improve handling of TS packets containing a raised TEI bit
When the TEI bit is raised, we should not trust any of the contents of the packet in question, including but not limited to its PID number. Considering that we don't trust the PID number of this packet, we should not proceed to check the packet counter (if dvb_demux_tscheck is set). We should expect to see at least one discontinuity after a bad packet is received, so any time a TEI is detected, a following TS packet counter mismatch is to be expected. There is no real reason to ever allow bad packets to pass through the kernel demux, other than for purposes of attempting error correction via software or statistical information. However, since we have always passed these bad packets though the demux, we should not change this default behavior. Without altering module options, this patch merely prevents the TS packet counter check on packets containing a raised TEI. If module option dvb_demux_feed_err_pkts is set to 0, the kernel demux will drop these error packets entirely, preventing any possibility of corruption caused by userspace programs that are expecting valid data. Signed-off-by: Michael Krufky mkru...@linuxtv.org --- drivers/media/dvb/dvb-core/dvb_demux.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c index d82469f..17cb81f 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/drivers/media/dvb/dvb-core/dvb_demux.c @@ -50,6 +50,11 @@ module_param(dvb_demux_speedcheck, int, 0644); MODULE_PARM_DESC(dvb_demux_speedcheck, enable transport stream speed check); +static int dvb_demux_feed_err_pkts = 1; +module_param(dvb_demux_feed_err_pkts, int, 0644); +MODULE_PARM_DESC(dvb_demux_feed_err_pkts, +when set to 0, drop packets with the TEI bit set (1 by default)); + #define dprintk_tscheck(x...) do { \ if (dvb_demux_tscheck printk_ratelimit())\ printk(x); \ @@ -426,14 +431,18 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) }; }; + if (buf[1] 0x80) { + dprintk_tscheck(TEI detected. + PID=0x%x data1=0x%x\n, + pid, buf[1]); + /* data in this packet cant be trusted - drop it unless +* module option dvb_demux_feed_err_pkts is set */ + if (!dvb_demux_feed_err_pkts) + return; + } else /* if TEI bit is set, pid may be wrong- skip pkt counter */ if (demux-cnt_storage dvb_demux_tscheck) { /* check pkt counter */ if (pid MAX_PID) { - if (buf[1] 0x80) - dprintk_tscheck(TEI detected. - PID=0x%x data1=0x%x\n, - pid, buf[1]); - if ((buf[3] 0xf) != demux-cnt_storage[pid]) dprintk_tscheck(TS packet counter mismatch. PID=0x%x expected 0x%x -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] video: mx2_camera: Fix build error due to the lack of 'pixfmt' definition
commit d509835 ([media] media: mx2_camera: Fix mbus format handling) caused the following build error: drivers/media/video/mx2_camera.c:1032:42: error: 'pixfmt' undeclared (first use in this function) make[4]: *** [drivers/media/video/mx2_camera.o] Error 1 Fix this build error by providing a 'pixfmt' definition. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- drivers/media/video/mx2_camera.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index ded26b7..ef72733 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -989,6 +989,7 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) int ret; int bytesperline; u32 csicr1 = pcdev-csicr1; + u32 pixfmt = icd-current_fmt-host_fmt-fourcc; ret = v4l2_subdev_call(sd, video, g_mbus_config, cfg); if (!ret) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html