Re: [PATCH 2/2] vicodec: set state->info before calling the encode/decode funcs
On 09/10/2018 05:37 PM, Ezequiel Garcia wrote: > On Mon, 2018-09-10 at 17:00 +0200, Hans Verkuil wrote: >> From: Hans Verkuil >> >> state->info was NULL since I completely forgot to set state->info. >> Oops. >> >> Reported-by: Ezequiel Garcia >> Signed-off-by: Hans Verkuil > > For both patches: > > Tested-by: Ezequiel Garcia > > With these changes, now this gstreamer pipeline no longer > crashes: > > gst-launch-1.0 -v videotestsrc num-buffers=30 ! > video/x-raw,width=1280,height=720 ! v4l2fwhtenc capture-io-mode=mmap > output-io-mode=mmap ! v4l2fwhtdec > capture-io-mode=mmap output-io-mode=mmap ! fakesink > > A few things: > > * You now need to mark "[PATCH] vicodec: fix sparse warning" as invalid. I'll wait for that to be merged (it's already in a pending pull request), then rework this patch and add your other patches for a new pull request. > * v4l2fwhtenc/v4l2fwhtdec elements are not upstream yet. > * Gstreamer doesn't end properly; and it seems to negotiate > different sizes for encoded and decoded unless explicitly set. As mentioned before, vicodec isn't fully compliant with the upcoming codec spec, and is also missing certain features (selection support, support for custom bytesperline values, padding, midstream resolution changes). Patches are welcome. If you are working on gstreamer elements for this codec, then it would be great if you could look at making the driver compliant. I have no plans to work on vicodec until that codec spec is fully finalized, so you can go ahead with that if you want to. Would be really nice, and after all, that's why I wrote vicodec! Regards, Hans > > Thanks! > >> drivers/media/platform/vicodec/vicodec-core.c | 11 +++ >> 1 file changed, 7 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/media/platform/vicodec/vicodec-core.c >> b/drivers/media/platform/vicodec/vicodec-core.c >> index fdd77441a47b..5d42a8414283 100644 >> --- a/drivers/media/platform/vicodec/vicodec-core.c >> +++ b/drivers/media/platform/vicodec/vicodec-core.c >> @@ -176,12 +176,15 @@ static int device_process(struct vicodec_ctx *ctx, >> } >> >> if (ctx->is_enc) { >> -unsigned int size = v4l2_fwht_encode(state, p_in, p_out); >> - >> -vb2_set_plane_payload(_vb->vb2_buf, 0, size); >> +state->info = q_out->info; >> +ret = v4l2_fwht_encode(state, p_in, p_out); >> +if (ret < 0) >> +return ret; >> +vb2_set_plane_payload(_vb->vb2_buf, 0, ret); >> } else { >> +state->info = q_cap->info; >> ret = v4l2_fwht_decode(state, p_in, p_out); >> -if (ret) >> +if (ret < 0) >> return ret; >> vb2_set_plane_payload(_vb->vb2_buf, 0, q_cap->sizeimage); >> } >
Re: [PATCH 2/2] vicodec: set state->info before calling the encode/decode funcs
On Mon, 2018-09-10 at 13:16 -0400, Nicolas Dufresne wrote: > Le lundi 10 septembre 2018 à 12:37 -0300, Ezequiel Garcia a écrit : > > On Mon, 2018-09-10 at 17:00 +0200, Hans Verkuil wrote: > > > From: Hans Verkuil > > > > > > state->info was NULL since I completely forgot to set state->info. > > > Oops. > > > > > > Reported-by: Ezequiel Garcia > > > Signed-off-by: Hans Verkuil > > > > For both patches: > > > > Tested-by: Ezequiel Garcia > > > > With these changes, now this gstreamer pipeline no longer > > crashes: > > > > gst-launch-1.0 -v videotestsrc num-buffers=30 ! video/x- > > raw,width=1280,height=720 ! v4l2fwhtenc capture-io-mode=mmap output- > > io-mode=mmap ! v4l2fwhtdec > > capture-io-mode=mmap output-io-mode=mmap ! fakesink > > > > A few things: > > > > * You now need to mark "[PATCH] vicodec: fix sparse warning" as > > invalid. > > * v4l2fwhtenc/v4l2fwhtdec elements are not upstream yet. > > * Gstreamer doesn't end properly; and it seems to negotiate > > Is the driver missing CMD_STOP implementation ? (draining flow) > I think that's the case. Gstreamer debug log, right before it stalls: 0:00:16.929785442 180 0x5593bcbd18a0 DEBUG v4l2videodec gstv4l2videodec.c:375:gst_v4l2_video_dec_finish: Finishing decoding 0:00:16.931866009 180 0x5593bcbd18a0 DEBUG v4l2videodec gstv4l2videodec.c:340:gst_v4l2_decoder_cmd: sending v4l2 decoder command 1 with flags 0 0:00:16.934260349 180 0x5593bcbd18a0 DEBUG v4l2videodec gstv4l2videodec.c:384:gst_v4l2_video_dec_finish: Waiting for decoder stop [stalls here] Regards, Ezequiel
Re: [PATCH 2/2] vicodec: set state->info before calling the encode/decode funcs
Le lundi 10 septembre 2018 à 12:37 -0300, Ezequiel Garcia a écrit : > On Mon, 2018-09-10 at 17:00 +0200, Hans Verkuil wrote: > > From: Hans Verkuil > > > > state->info was NULL since I completely forgot to set state->info. > > Oops. > > > > Reported-by: Ezequiel Garcia > > Signed-off-by: Hans Verkuil > > For both patches: > > Tested-by: Ezequiel Garcia > > With these changes, now this gstreamer pipeline no longer > crashes: > > gst-launch-1.0 -v videotestsrc num-buffers=30 ! video/x- > raw,width=1280,height=720 ! v4l2fwhtenc capture-io-mode=mmap output- > io-mode=mmap ! v4l2fwhtdec > capture-io-mode=mmap output-io-mode=mmap ! fakesink > > A few things: > > * You now need to mark "[PATCH] vicodec: fix sparse warning" as > invalid. > * v4l2fwhtenc/v4l2fwhtdec elements are not upstream yet. > * Gstreamer doesn't end properly; and it seems to negotiate Is the driver missing CMD_STOP implementation ? (draining flow) > different sizes for encoded and decoded unless explicitly set. > > Thanks! > > > drivers/media/platform/vicodec/vicodec-core.c | 11 +++ > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/media/platform/vicodec/vicodec-core.c > > b/drivers/media/platform/vicodec/vicodec-core.c > > index fdd77441a47b..5d42a8414283 100644 > > --- a/drivers/media/platform/vicodec/vicodec-core.c > > +++ b/drivers/media/platform/vicodec/vicodec-core.c > > @@ -176,12 +176,15 @@ static int device_process(struct vicodec_ctx > > *ctx, > > } > > > > if (ctx->is_enc) { > > - unsigned int size = v4l2_fwht_encode(state, p_in, > > p_out); > > - > > - vb2_set_plane_payload(_vb->vb2_buf, 0, size); > > + state->info = q_out->info; > > + ret = v4l2_fwht_encode(state, p_in, p_out); > > + if (ret < 0) > > + return ret; > > + vb2_set_plane_payload(_vb->vb2_buf, 0, ret); > > } else { > > + state->info = q_cap->info; > > ret = v4l2_fwht_decode(state, p_in, p_out); > > - if (ret) > > + if (ret < 0) > > return ret; > > vb2_set_plane_payload(_vb->vb2_buf, 0, q_cap- > > >sizeimage); > > } > > signature.asc Description: This is a digitally signed message part
Re: [PATCH 2/2] vicodec: set state->info before calling the encode/decode funcs
On Mon, 2018-09-10 at 17:00 +0200, Hans Verkuil wrote: > From: Hans Verkuil > > state->info was NULL since I completely forgot to set state->info. > Oops. > > Reported-by: Ezequiel Garcia > Signed-off-by: Hans Verkuil For both patches: Tested-by: Ezequiel Garcia With these changes, now this gstreamer pipeline no longer crashes: gst-launch-1.0 -v videotestsrc num-buffers=30 ! video/x-raw,width=1280,height=720 ! v4l2fwhtenc capture-io-mode=mmap output-io-mode=mmap ! v4l2fwhtdec capture-io-mode=mmap output-io-mode=mmap ! fakesink A few things: * You now need to mark "[PATCH] vicodec: fix sparse warning" as invalid. * v4l2fwhtenc/v4l2fwhtdec elements are not upstream yet. * Gstreamer doesn't end properly; and it seems to negotiate different sizes for encoded and decoded unless explicitly set. Thanks! > drivers/media/platform/vicodec/vicodec-core.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/vicodec/vicodec-core.c > b/drivers/media/platform/vicodec/vicodec-core.c > index fdd77441a47b..5d42a8414283 100644 > --- a/drivers/media/platform/vicodec/vicodec-core.c > +++ b/drivers/media/platform/vicodec/vicodec-core.c > @@ -176,12 +176,15 @@ static int device_process(struct vicodec_ctx *ctx, > } > > if (ctx->is_enc) { > - unsigned int size = v4l2_fwht_encode(state, p_in, p_out); > - > - vb2_set_plane_payload(_vb->vb2_buf, 0, size); > + state->info = q_out->info; > + ret = v4l2_fwht_encode(state, p_in, p_out); > + if (ret < 0) > + return ret; > + vb2_set_plane_payload(_vb->vb2_buf, 0, ret); > } else { > + state->info = q_cap->info; > ret = v4l2_fwht_decode(state, p_in, p_out); > - if (ret) > + if (ret < 0) > return ret; > vb2_set_plane_payload(_vb->vb2_buf, 0, q_cap->sizeimage); > }
[PATCH 2/2] vicodec: set state->info before calling the encode/decode funcs
From: Hans Verkuil state->info was NULL since I completely forgot to set state->info. Oops. Reported-by: Ezequiel Garcia Signed-off-by: Hans Verkuil --- drivers/media/platform/vicodec/vicodec-core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index fdd77441a47b..5d42a8414283 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -176,12 +176,15 @@ static int device_process(struct vicodec_ctx *ctx, } if (ctx->is_enc) { - unsigned int size = v4l2_fwht_encode(state, p_in, p_out); - - vb2_set_plane_payload(_vb->vb2_buf, 0, size); + state->info = q_out->info; + ret = v4l2_fwht_encode(state, p_in, p_out); + if (ret < 0) + return ret; + vb2_set_plane_payload(_vb->vb2_buf, 0, ret); } else { + state->info = q_cap->info; ret = v4l2_fwht_decode(state, p_in, p_out); - if (ret) + if (ret < 0) return ret; vb2_set_plane_payload(_vb->vb2_buf, 0, q_cap->sizeimage); } -- 2.18.0
info!!
Top of the day to you, this is in respect of a very beneficial transaction which you would not want to let go reply for more details, Regards, Lee
[PATCH v2 0/3] DVB: represent frequencies at tuner/frontend .info in Hz
Currently, the DVB drivers internally represent frequencies on their ops.info structures in Hz, for Terrestrial and Cable, or in kHz for Satellite. This is very confusing, as from time to time developers end by filling the data in a wrong way. Also, this is a long standing issue that affect newer devices whose tuner and frontend are capable of supporting both satellite and non-satellite delivery standards, as, ideally, a single frequency range should be enough to represent both. There is a side issue here to: currently, the Kernel uses internally the same struct as FE_GET_INFO, with has several fields that aren't used anymore, causing some waste of space a the Kernel. So, convert all those data to Hz. As a plus, after this change, if we ever need to add a tuner capable of working above 2^32 Hz (e. g. above 4.294 GHz), a simple change from u32 to u64 internally would do the work. We may end needing such tuners for SDR. Tested with a random number of devices I have in hands: - PCTV 461e - WinTV aero-m - Terratec H5 - WinTV dual-HD model 204201 rev. C216 - WinTV HVR-955Q - PV-D231U(RN)-F For the tests, I used the newer version of dvb-fe-tool with now displays the frequencies and symbol rates read from FE_GET_INFO. Except if I screwed with a frontend/tuner entry, no userspace change is expected with this patch, as dvb_frontend.c will properly return the frequencies to userspace using the right range (either kHz or Hz). - v2: - fixed some bugs on a few driver frequency conversions; - added an extra patch to also consider the tuner frequency_stepsize, as it may be different than the frontend one. So, get the bigger value among both. Mauro Carvalho Chehab (3): media: dvb: convert tuner_info frequencies to Hz media: dvb: represent min/max/step/tolerance freqs in Hz dvb_frontend: ensure that the step is ok for both FE and tuner drivers/media/common/siano/smsdvb-main.c | 6 +- drivers/media/dvb-core/dvb_frontend.c | 84 +++ drivers/media/dvb-frontends/af9013.c | 7 +- drivers/media/dvb-frontends/af9033.c | 7 +- drivers/media/dvb-frontends/as102_fe.c| 6 +- drivers/media/dvb-frontends/ascot2e.c | 6 +- drivers/media/dvb-frontends/atbm8830.c| 6 +- drivers/media/dvb-frontends/au8522_dig.c | 6 +- drivers/media/dvb-frontends/bcm3510.c | 6 +- drivers/media/dvb-frontends/cx22700.c | 6 +- drivers/media/dvb-frontends/cx22702.c | 6 +- drivers/media/dvb-frontends/cx24110.c | 8 +- drivers/media/dvb-frontends/cx24113.c | 8 +- drivers/media/dvb-frontends/cx24116.c | 8 +- drivers/media/dvb-frontends/cx24117.c | 8 +- drivers/media/dvb-frontends/cx24120.c | 8 +- drivers/media/dvb-frontends/cx24123.c | 8 +- drivers/media/dvb-frontends/cxd2820r_t.c | 4 +- drivers/media/dvb-frontends/cxd2820r_t2.c | 4 +- drivers/media/dvb-frontends/cxd2841er.c | 9 +- .../media/dvb-frontends/cxd2880/cxd2880_top.c | 6 +- drivers/media/dvb-frontends/dib0070.c | 8 +- drivers/media/dvb-frontends/dib0090.c | 12 +-- drivers/media/dvb-frontends/dib3000mb.c | 6 +- drivers/media/dvb-frontends/dib3000mc.c | 6 +- drivers/media/dvb-frontends/dib7000m.c| 6 +- drivers/media/dvb-frontends/dib7000p.c| 6 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 6 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +- drivers/media/dvb-frontends/drxd_hard.c | 7 +- drivers/media/dvb-frontends/drxk_hard.c | 8 +- drivers/media/dvb-frontends/ds3000.c | 8 +- drivers/media/dvb-frontends/dvb-pll.c | 16 +++- drivers/media/dvb-frontends/dvb_dummy_fe.c| 24 +++--- drivers/media/dvb-frontends/gp8psk-fe.c | 6 +- drivers/media/dvb-frontends/helene.c | 12 +-- drivers/media/dvb-frontends/horus3a.c | 6 +- drivers/media/dvb-frontends/itd1000.c | 8 +- drivers/media/dvb-frontends/ix2505v.c | 8 +- drivers/media/dvb-frontends/l64781.c | 7 +- drivers/media/dvb-frontends/lg2160.c | 12 +-- drivers/media/dvb-frontends/lgdt3305.c| 12 +-- drivers/media/dvb-frontends/lgdt3306a.c | 6 +- drivers/media/dvb-frontends/lgdt330x.c| 12 +-- drivers/media/dvb-frontends/lgs8gl5.c | 7 +- drivers/media/dvb-frontends/lgs8gxx.c | 6 +- drivers/media/dvb-frontends/m88ds3103.c | 6 +- drivers/media/dvb-frontends/m88rs2000.c | 8 +- drivers/media/dvb-frontends/mb86a16.c | 7 +- drivers/media/dvb-frontends/mb86a20s.c| 6 +- drivers/media/dvb-frontends/mt312.c | 10 +-- drivers/media/dvb-frontends/mt352.c | 7 +- drivers/media/dvb-frontends/mxl5xx.c | 6 +- drivers/media/dvb-frontends/nxt200x.c | 6 +-
[PATCH 0/2] DVB: represent frequencies at tuner/frontend .info in Hz
This is a long standing issue that affect newer devices whose tuner and frontend are capable of supporting both satellite and non-satellite delivery standards. Compile-tested only. I intend to run some tests later this week with some random hardware, but I'd appreciate any tests and feedback, as it is not hard to break something, but we can't cook an omelet without breaking some eggs. Mauro Carvalho Chehab (2): media: dvb: convert tuner_info frequencies to Hz media: dvb: represent min/max/step/tolerance freqs in Hz drivers/media/common/siano/smsdvb-main.c | 6 +- drivers/media/dvb-core/dvb_frontend.c | 63 +++ drivers/media/dvb-frontends/af9013.c | 7 +-- drivers/media/dvb-frontends/af9033.c | 7 +-- drivers/media/dvb-frontends/as102_fe.c| 6 +- drivers/media/dvb-frontends/ascot2e.c | 6 +- drivers/media/dvb-frontends/atbm8830.c| 6 +- drivers/media/dvb-frontends/au8522_dig.c | 6 +- drivers/media/dvb-frontends/bcm3510.c | 6 +- drivers/media/dvb-frontends/cx22700.c | 6 +- drivers/media/dvb-frontends/cx22702.c | 6 +- drivers/media/dvb-frontends/cx24110.c | 8 +-- drivers/media/dvb-frontends/cx24113.c | 8 +-- drivers/media/dvb-frontends/cx24116.c | 8 +-- drivers/media/dvb-frontends/cx24117.c | 8 +-- drivers/media/dvb-frontends/cx24120.c | 8 +-- drivers/media/dvb-frontends/cx24123.c | 8 +-- drivers/media/dvb-frontends/cxd2820r_t.c | 4 +- drivers/media/dvb-frontends/cxd2820r_t2.c | 4 +- drivers/media/dvb-frontends/cxd2841er.c | 9 ++- .../media/dvb-frontends/cxd2880/cxd2880_top.c | 6 +- drivers/media/dvb-frontends/dib0070.c | 8 +-- drivers/media/dvb-frontends/dib0090.c | 12 ++-- drivers/media/dvb-frontends/dib3000mb.c | 6 +- drivers/media/dvb-frontends/dib3000mc.c | 6 +- drivers/media/dvb-frontends/dib7000m.c| 6 +- drivers/media/dvb-frontends/dib7000p.c| 6 +- drivers/media/dvb-frontends/dib8000.c | 6 +- drivers/media/dvb-frontends/dib9000.c | 6 +- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +- drivers/media/dvb-frontends/drxd_hard.c | 7 +-- drivers/media/dvb-frontends/drxk_hard.c | 8 +-- drivers/media/dvb-frontends/ds3000.c | 8 +-- drivers/media/dvb-frontends/dvb-pll.c | 16 - drivers/media/dvb-frontends/dvb_dummy_fe.c| 24 +++ drivers/media/dvb-frontends/gp8psk-fe.c | 6 +- drivers/media/dvb-frontends/helene.c | 12 ++-- drivers/media/dvb-frontends/horus3a.c | 6 +- drivers/media/dvb-frontends/itd1000.c | 8 +-- drivers/media/dvb-frontends/ix2505v.c | 8 +-- drivers/media/dvb-frontends/l64781.c | 7 +-- drivers/media/dvb-frontends/lg2160.c | 12 ++-- drivers/media/dvb-frontends/lgdt3305.c| 12 ++-- drivers/media/dvb-frontends/lgdt3306a.c | 6 +- drivers/media/dvb-frontends/lgdt330x.c| 12 ++-- drivers/media/dvb-frontends/lgs8gl5.c | 7 +-- drivers/media/dvb-frontends/lgs8gxx.c | 6 +- drivers/media/dvb-frontends/m88ds3103.c | 6 +- drivers/media/dvb-frontends/m88rs2000.c | 8 +-- drivers/media/dvb-frontends/mb86a16.c | 7 +-- drivers/media/dvb-frontends/mb86a20s.c| 6 +- drivers/media/dvb-frontends/mt312.c | 10 +-- drivers/media/dvb-frontends/mt352.c | 7 +-- drivers/media/dvb-frontends/mxl5xx.c | 6 +- drivers/media/dvb-frontends/nxt200x.c | 6 +- drivers/media/dvb-frontends/nxt6000.c | 6 +- drivers/media/dvb-frontends/or51132.c | 6 +- drivers/media/dvb-frontends/or51211.c | 8 +-- drivers/media/dvb-frontends/rtl2830.c | 4 +- drivers/media/dvb-frontends/rtl2832.c | 10 +-- drivers/media/dvb-frontends/s5h1409.c | 6 +- drivers/media/dvb-frontends/s5h1411.c | 6 +- drivers/media/dvb-frontends/s5h1420.c | 8 +-- drivers/media/dvb-frontends/s5h1432.c | 6 +- drivers/media/dvb-frontends/s921.c| 7 +-- drivers/media/dvb-frontends/si2165.c | 2 +- drivers/media/dvb-frontends/si21xx.c | 7 +-- drivers/media/dvb-frontends/sp8870.c | 6 +- drivers/media/dvb-frontends/sp887x.c | 6 +- drivers/media/dvb-frontends/stb0899_drv.c | 6 +- drivers/media/dvb-frontends/stb6000.c | 4 +- drivers/media/dvb-frontends/stb6100.c | 5 +- drivers/media/dvb-frontends/stv0288.c | 7 +-- drivers/media/dvb-frontends/stv0297.c | 6 +- drivers/media/dvb-frontends/stv0299.c | 7 +-- drivers/media/dvb-frontends/stv0367.c | 20 +++--- drivers/media/dvb-frontends/stv0900_core.c| 7 +-- drivers/media/dvb-frontends/stv090x.c | 6 +- drivers/media/dvb-frontends/stv0910.c | 6 +- drivers/media/dvb-frontends/stv6110.c | 6 +-
[PATCH] media: gspca: fix Kconfig help info
Documentation/video4linux/gspca.txt is missing. It has moved to Documentation/media/v4l-drivers/gspca-cardlist.rst Signed-off-by: winton.liu <18502523...@163.com> --- drivers/media/usb/gspca/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/gspca/Kconfig b/drivers/media/usb/gspca/Kconfig index d214a21..bc9a439 100644 --- a/drivers/media/usb/gspca/Kconfig +++ b/drivers/media/usb/gspca/Kconfig @@ -7,7 +7,7 @@ menuconfig USB_GSPCA Say Y here if you want to enable selecting webcams based on the GSPCA framework. - See for more info. + See for more info. This driver uses the Video For Linux API. You must say Y or M to "Video For Linux" to use this driver. -- 2.7.4
[PATCH] media: em28xx-cards: output regular messages as info
Messages expected during device probe were being marked as errors. Signed-off-by: Chris Mayo--- drivers/media/usb/em28xx/em28xx-cards.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 6e0e67d23..8977c2be3 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3736,7 +3736,7 @@ static int em28xx_usb_probe(struct usb_interface *intf, speed = "unknown"; } - dev_err(>dev, + dev_info(>dev, "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n", udev->manufacturer ? udev->manufacturer : "", udev->product ? udev->product : "", @@ -3771,7 +3771,7 @@ static int em28xx_usb_probe(struct usb_interface *intf, dev->dev_next = NULL; if (has_vendor_audio) { - dev_err(>dev, + dev_info(>dev, "Audio interface %i found (Vendor Class)\n", ifnum); dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; } @@ -3790,12 +3790,12 @@ static int em28xx_usb_probe(struct usb_interface *intf, } if (has_video) - dev_err(>dev, "Video interface %i found:%s%s\n", + dev_info(>dev, "Video interface %i found:%s%s\n", ifnum, dev->analog_ep_bulk ? " bulk" : "", dev->analog_ep_isoc ? " isoc" : ""); if (has_dvb) - dev_err(>dev, "DVB interface %i found:%s%s\n", + dev_info(>dev, "DVB interface %i found:%s%s\n", ifnum, dev->dvb_ep_bulk ? " bulk" : "", dev->dvb_ep_isoc ? " isoc" : ""); @@ -3837,13 +3837,13 @@ static int em28xx_usb_probe(struct usb_interface *intf, if (has_video) { if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) dev->analog_xfer_bulk = 1; - dev_err(>dev, "analog set to %s mode.\n", + dev_info(>dev, "analog set to %s mode.\n", dev->analog_xfer_bulk ? "bulk" : "isoc"); } if (has_dvb) { if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) dev->dvb_xfer_bulk = 1; - dev_err(>dev, "dvb set to %s mode.\n", + dev_info(>dev, "dvb set to %s mode.\n", dev->dvb_xfer_bulk ? "bulk" : "isoc"); } -- 2.16.1
[PATCH 04/11] media: lgdt330x: print info when device gets probed
It is useful to know if the driver load succeded. So, add a printk info there. While here, improve the .init debug printed message. Signed-off-by: Mauro Carvalho Chehab <mche...@s-opensource.com> --- drivers/media/dvb-frontends/lgdt330x.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/lgdt330x.c b/drivers/media/dvb-frontends/lgdt330x.c index a3139eb69c93..1e52831cb603 100644 --- a/drivers/media/dvb-frontends/lgdt330x.c +++ b/drivers/media/dvb-frontends/lgdt330x.c @@ -299,7 +299,7 @@ static int lgdt330x_init(struct dvb_frontend *fe) printk(KERN_WARNING "Only LGDT3302 and LGDT3303 are supported chips.\n"); err = -ENODEV; } - dprintk("entered as %s\n", chip_name); + dprintk("Initialized the %s chip\n", chip_name); if (err < 0) return err; return lgdt330x_sw_reset(state); @@ -817,6 +817,9 @@ struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config, state->current_frequency = -1; state->current_modulation = -1; + pr_info("Demod loaded for LGDT330%s chip\n", + config->demod_chip == LGDT3302 ? "2" : "3"); + return >frontend; error: -- 2.14.3
Re: [PATCH 2/7] include/(uapi/)media: add SPDX license info
On 14/02/18 19:12, Mauro Carvalho Chehab wrote: > Em Wed, 7 Feb 2018 15:39:34 +0100 > Hans Verkuilescreveu: > >> From: Hans Verkuil >> >> Replace the old license information with the corresponding SPDX >> license for those headers that I authored. >> >> Signed-off-by: Hans Verkuil > > ... > >> diff --git a/include/uapi/linux/cec.h b/include/uapi/linux/cec.h >> index b51fbe1941a7..20fe091b7e96 100644 >> --- a/include/uapi/linux/cec.h >> +++ b/include/uapi/linux/cec.h >> @@ -3,35 +3,6 @@ >> * cec - HDMI Consumer Electronics Control public header >> * >> * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights >> reserved. >> - * >> - * This program is free software; you may redistribute it and/or modify >> - * it under the terms of the GNU General Public License as published by >> - * the Free Software Foundation; version 2 of the License. >> - * >> - * Alternatively you can redistribute this file under the terms of the >> - * BSD license as stated below: >> - * >> - * Redistribution and use in source and binary forms, with or without >> - * modification, are permitted provided that the following conditions >> - * are met: >> - * 1. Redistributions of source code must retain the above copyright >> - *notice, this list of conditions and the following disclaimer. >> - * 2. Redistributions in binary form must reproduce the above copyright >> - *notice, this list of conditions and the following disclaimer in >> - *the documentation and/or other materials provided with the >> - *distribution. >> - * 3. The names of its contributors may not be used to endorse or promote >> - *products derived from this software without specific prior written >> - *permission. >> - * >> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >> - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >> - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND >> - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS >> - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN >> - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN >> - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE >> - * SOFTWARE. >> */ > > You forgot to add an SPDX licence for this file. There is one already. It appears that someone went through all the uapi headers and added SPDX licenses. I just removed the now unnecessary boilerplate text. I admit, it's not clear from the diff :-) just two more context lines at the start and you'd have seen it. Regards, Hans
Re: [PATCH 2/7] include/(uapi/)media: add SPDX license info
Em Wed, 7 Feb 2018 15:39:34 +0100 Hans Verkuilescreveu: > From: Hans Verkuil > > Replace the old license information with the corresponding SPDX > license for those headers that I authored. > > Signed-off-by: Hans Verkuil ... > diff --git a/include/uapi/linux/cec.h b/include/uapi/linux/cec.h > index b51fbe1941a7..20fe091b7e96 100644 > --- a/include/uapi/linux/cec.h > +++ b/include/uapi/linux/cec.h > @@ -3,35 +3,6 @@ > * cec - HDMI Consumer Electronics Control public header > * > * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights > reserved. > - * > - * This program is free software; you may redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; version 2 of the License. > - * > - * Alternatively you can redistribute this file under the terms of the > - * BSD license as stated below: > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions > - * are met: > - * 1. Redistributions of source code must retain the above copyright > - *notice, this list of conditions and the following disclaimer. > - * 2. Redistributions in binary form must reproduce the above copyright > - *notice, this list of conditions and the following disclaimer in > - *the documentation and/or other materials provided with the > - *distribution. > - * 3. The names of its contributors may not be used to endorse or promote > - *products derived from this software without specific prior written > - *permission. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND > - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS > - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN > - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > - * SOFTWARE. > */ You forgot to add an SPDX licence for this file. Thanks, Mauro
[PATCH 6/7] i2c: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license for those drivers Cisco authored. Signed-off-by: Hans Verkuil --- drivers/media/i2c/ad9389b.c | 14 +- drivers/media/i2c/adv7511.c | 14 +- drivers/media/i2c/adv7604.c | 14 +- drivers/media/i2c/adv7842.c | 15 +-- drivers/media/i2c/tc358743.c | 15 +-- drivers/media/i2c/tc358743_regs.h | 15 +-- 6 files changed, 6 insertions(+), 81 deletions(-) diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index a056d6cd..91ff06088572 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Analog Devices AD9389B/AD9889B video encoder driver * * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ /* diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 2817bafc67bf..d23505a411ee 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Analog Devices ADV7511 HDMI Transmitter Device Driver * * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 1544920ec52d..b2caaff945ab 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1,21 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * adv7604 - Analog Devices ADV7604 video decoder driver * * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved. * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * */ /* diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 136aa80a834b..fddac32e5051 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -1,21 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * adv7842 - Analog Devices ADV7842 video decoder driver * * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - *
[PATCH 3/7] vivid: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license. Signed-off-by: Hans Verkuil --- drivers/media/platform/vivid/vivid-cec.c | 14 +- drivers/media/platform/vivid/vivid-cec.h | 14 +- drivers/media/platform/vivid/vivid-core.c | 14 +- drivers/media/platform/vivid/vivid-core.h | 14 +- drivers/media/platform/vivid/vivid-ctrls.c| 14 +- drivers/media/platform/vivid/vivid-ctrls.h| 14 +- drivers/media/platform/vivid/vivid-kthread-cap.c | 14 +- drivers/media/platform/vivid/vivid-kthread-cap.h | 14 +- drivers/media/platform/vivid/vivid-kthread-out.c | 14 +- drivers/media/platform/vivid/vivid-kthread-out.h | 14 +- drivers/media/platform/vivid/vivid-osd.c | 14 +- drivers/media/platform/vivid/vivid-osd.h | 14 +- drivers/media/platform/vivid/vivid-radio-common.c | 14 +- drivers/media/platform/vivid/vivid-radio-common.h | 14 +- drivers/media/platform/vivid/vivid-radio-rx.c | 14 +- drivers/media/platform/vivid/vivid-radio-rx.h | 14 +- drivers/media/platform/vivid/vivid-radio-tx.c | 14 +- drivers/media/platform/vivid/vivid-radio-tx.h | 14 +- drivers/media/platform/vivid/vivid-rds-gen.c | 14 +- drivers/media/platform/vivid/vivid-rds-gen.h | 14 +- drivers/media/platform/vivid/vivid-sdr-cap.c | 14 +- drivers/media/platform/vivid/vivid-sdr-cap.h | 14 +- drivers/media/platform/vivid/vivid-vbi-cap.c | 14 +- drivers/media/platform/vivid/vivid-vbi-cap.h | 14 +- drivers/media/platform/vivid/vivid-vbi-gen.c | 14 +- drivers/media/platform/vivid/vivid-vbi-gen.h | 14 +- drivers/media/platform/vivid/vivid-vbi-out.c | 14 +- drivers/media/platform/vivid/vivid-vbi-out.h | 14 +- drivers/media/platform/vivid/vivid-vid-cap.c | 14 +- drivers/media/platform/vivid/vivid-vid-cap.h | 14 +- drivers/media/platform/vivid/vivid-vid-common.c | 14 +- drivers/media/platform/vivid/vivid-vid-common.h | 14 +- drivers/media/platform/vivid/vivid-vid-out.c | 14 +- drivers/media/platform/vivid/vivid-vid-out.h | 14 +- 34 files changed, 34 insertions(+), 442 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-cec.c b/drivers/media/platform/vivid/vivid-cec.c index b55d278d38a7..619bd8435b7f 100644 --- a/drivers/media/platform/vivid/vivid-cec.c +++ b/drivers/media/platform/vivid/vivid-cec.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * vivid-cec.c - A Virtual Video Test Driver, cec emulation * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/platform/vivid/vivid-cec.h b/drivers/media/platform/vivid/vivid-cec.h index 3926b1422777..7524ed48a914 100644 --- a/drivers/media/platform/vivid/vivid-cec.h +++ b/drivers/media/platform/vivid/vivid-cec.h @@ -1,20 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * vivid-cec.h - A Virtual Video Test Driver, cec emulation * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #ifdef
[PATCH 5/7] cec: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license. Signed-off-by: Hans Verkuil --- drivers/media/cec/cec-adap.c | 14 +- drivers/media/cec/cec-api.c | 14 +- drivers/media/cec/cec-core.c | 14 +- drivers/media/cec/cec-edid.c | 14 +- drivers/media/cec/cec-notifier.c | 14 +- drivers/media/cec/cec-pin-priv.h | 14 +- drivers/media/cec/cec-pin.c | 14 +- drivers/media/cec/cec-priv.h | 14 +- 8 files changed, 8 insertions(+), 104 deletions(-) diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c index 2b1e540587d6..768f7d70b55c 100644 --- a/drivers/media/cec/cec-adap.c +++ b/drivers/media/cec/cec-adap.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * cec-adap.c - HDMI Consumer Electronics Control framework - CEC adapter * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c index 37e468074dc1..af1b562ad2ea 100644 --- a/drivers/media/cec/cec-api.c +++ b/drivers/media/cec/cec-api.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * cec-api.c - HDMI Consumer Electronics Control framework - API * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c index a9f9525db9ae..e47ea22b3c23 100644 --- a/drivers/media/cec/cec-core.c +++ b/drivers/media/cec/cec-core.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * cec-core.c - HDMI Consumer Electronics Control framework - Core * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/cec/cec-edid.c b/drivers/media/cec/cec-edid.c index 38e3fec6152b..ec72ac1c0b91 100644 --- a/drivers/media/cec/cec-edid.c +++ b/drivers/media/cec/cec-edid.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * cec-edid - HDMI Consumer Electronics Control EDID & CEC helper functions * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
[PATCH 4/7] cobalt: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license. Signed-off-by: Hans Verkuil --- drivers/media/pci/cobalt/Makefile | 1 + drivers/media/pci/cobalt/cobalt-alsa-main.c| 14 +- drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 14 +- drivers/media/pci/cobalt/cobalt-alsa-pcm.h | 14 +- drivers/media/pci/cobalt/cobalt-alsa.h | 14 +- drivers/media/pci/cobalt/cobalt-cpld.c | 14 +- drivers/media/pci/cobalt/cobalt-cpld.h | 14 +- drivers/media/pci/cobalt/cobalt-driver.c | 14 +- drivers/media/pci/cobalt/cobalt-driver.h | 14 +- drivers/media/pci/cobalt/cobalt-flash.c| 14 +- drivers/media/pci/cobalt/cobalt-flash.h| 14 +- drivers/media/pci/cobalt/cobalt-i2c.c | 14 +- drivers/media/pci/cobalt/cobalt-i2c.h | 14 +- drivers/media/pci/cobalt/cobalt-irq.c | 14 +- drivers/media/pci/cobalt/cobalt-irq.h | 14 +- drivers/media/pci/cobalt/cobalt-omnitek.c | 14 +- drivers/media/pci/cobalt/cobalt-omnitek.h | 14 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +- drivers/media/pci/cobalt/cobalt-v4l2.h | 14 +- .../media/pci/cobalt/m00233_video_measure_memmap_package.h | 14 +- .../media/pci/cobalt/m00235_fdma_packer_memmap_package.h | 14 +- drivers/media/pci/cobalt/m00389_cvi_memmap_package.h | 14 +- drivers/media/pci/cobalt/m00460_evcnt_memmap_package.h | 14 +- drivers/media/pci/cobalt/m00473_freewheel_memmap_package.h | 14 +- .../pci/cobalt/m00479_clk_loss_detector_memmap_package.h | 14 +- .../pci/cobalt/m00514_syncgen_flow_evcnt_memmap_package.h | 14 +- 26 files changed, 26 insertions(+), 325 deletions(-) diff --git a/drivers/media/pci/cobalt/Makefile b/drivers/media/pci/cobalt/Makefile index b328955abbd2..29eddff2f35f 100644 --- a/drivers/media/pci/cobalt/Makefile +++ b/drivers/media/pci/cobalt/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 cobalt-objs:= cobalt-driver.o cobalt-irq.o cobalt-v4l2.o \ cobalt-i2c.o cobalt-omnitek.o cobalt-flash.o cobalt-cpld.o \ cobalt-alsa-main.o cobalt-alsa-pcm.o diff --git a/drivers/media/pci/cobalt/cobalt-alsa-main.c b/drivers/media/pci/cobalt/cobalt-alsa-main.c index 720e3ad93a9e..e5022b620856 100644 --- a/drivers/media/pci/cobalt/cobalt-alsa-main.c +++ b/drivers/media/pci/cobalt/cobalt-alsa-main.c @@ -1,21 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ALSA interface to cobalt PCM capture streams * * Copyright 2014-2015 Cisco Systems, Inc. and/or its affiliates. * All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/pci/cobalt/cobalt-alsa-pcm.c b/drivers/media/pci/cobalt/cobalt-alsa-pcm.c index b69b258d39b9..f6a7df13cd04 100644 --- a/drivers/media/pci/cobalt/cobalt-alsa-pcm.c +++ b/drivers/media/pci/cobalt/cobalt-alsa-pcm.c @@ -1,22 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ALSA PCM device for the * ALSA interface to cobalt PCM capture streams * * Copyright 2014-2015 Cisco Systems, Inc. and/or its affiliates. * All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF
[PATCH 2/7] include/(uapi/)media: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license for those headers that I authored. Signed-off-by: Hans Verkuil --- include/media/cec-notifier.h| 14 +- include/media/cec-pin.h | 14 +- include/media/cec.h | 14 +- include/media/i2c/ad9389b.h | 14 +- include/media/i2c/adv7511.h | 14 +- include/media/i2c/adv7604.h | 15 +-- include/media/i2c/adv7842.h | 15 +-- include/media/i2c/tc358743.h| 18 ++ include/media/i2c/ths7303.h | 10 +- include/media/i2c/uda1342.h | 15 +-- include/media/tpg/v4l2-tpg.h| 14 +- include/media/v4l2-dv-timings.h | 15 +-- include/media/v4l2-rect.h | 14 +- include/uapi/linux/cec-funcs.h | 29 - include/uapi/linux/cec.h| 29 - 15 files changed, 14 insertions(+), 230 deletions(-) diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h index 57ec319a7f44..cf0add70b0e7 100644 --- a/include/media/cec-notifier.h +++ b/include/media/cec-notifier.h @@ -1,21 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * cec-notifier.h - notify CEC drivers of physical address changes * * Copyright 2016 Russell King * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #ifndef LINUX_CEC_NOTIFIER_H diff --git a/include/media/cec-pin.h b/include/media/cec-pin.h index 83b3e17e0a07..ed16c6dde0ba 100644 --- a/include/media/cec-pin.h +++ b/include/media/cec-pin.h @@ -1,20 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * cec-pin.h - low-level CEC pin control * * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #ifndef LINUX_CEC_PIN_H diff --git a/include/media/cec.h b/include/media/cec.h index 7cdf71d7125a..9afba9b558df 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -1,20 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * cec - HDMI Consumer Electronics Control support header * * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #ifndef _MEDIA_CEC_H diff --git a/include/media/i2c/ad9389b.h b/include/media/i2c/ad9389b.h index 5ba9af869b8b..30f9ea9a1273 100644 --- a/include/media/i2c/ad9389b.h +++ b/include/media/i2c/ad9389b.h @@ -1,20 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Analog Devices AD9389B/AD9889B video encoder driver header * * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of
[PATCH 7/7] media: add SPDX license info
From: Hans VerkuilReplace the old license information with the corresponding SPDX license for the remaining media drivers that Cisco authored. Signed-off-by: Hans Verkuil --- drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c | 14 +- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 14 +- drivers/media/platform/cec-gpio/cec-gpio.c | 14 +- drivers/media/radio/radio-raremono.c| 14 +- drivers/media/radio/si4713/radio-usb-si4713.c | 14 +- drivers/media/v4l2-core/v4l2-dv-timings.c | 15 +-- 6 files changed, 6 insertions(+), 79 deletions(-) diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c index 43180204fab2..3a3dc23c560c 100644 --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * v4l2-tpg-colors.c - A table that converts colors to various colorspaces * @@ -20,19 +21,6 @@ * in order to preserve precision. * * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c index 2b3d4ac4dfd4..d248d1fb9d1d 100644 --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * v4l2-tpg-core.c - Test Pattern Generator * @@ -5,19 +6,6 @@ * vivi.c source for the copyright information of those functions. * * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/platform/cec-gpio/cec-gpio.c b/drivers/media/platform/cec-gpio/cec-gpio.c index 5debdf08fbe7..f1f28cf5c751 100644 --- a/drivers/media/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/platform/cec-gpio/cec-gpio.c @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include diff --git a/drivers/media/radio/radio-raremono.c b/drivers/media/radio/radio-raremono.c index 70a2c86774ce..9a5079d64c4a 100644 --- a/drivers/media/radio/radio-raremono.c +++ b/drivers/media/radio/radio-raremono.c @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR
[PATCH 21/22] media: docs: add documentation for frontend attach info
Add to the media book the attachment kAPI for the DVB frontend drivers that have already some kernel-doc markup. Signed-off-by: Mauro Carvalho Chehab--- Documentation/media/dvb-drivers/frontends.rst | 30 +++ Documentation/media/dvb-drivers/index.rst | 1 + 2 files changed, 31 insertions(+) create mode 100644 Documentation/media/dvb-drivers/frontends.rst diff --git a/Documentation/media/dvb-drivers/frontends.rst b/Documentation/media/dvb-drivers/frontends.rst new file mode 100644 index ..1f5f57989196 --- /dev/null +++ b/Documentation/media/dvb-drivers/frontends.rst @@ -0,0 +1,30 @@ + +Frontend drivers + + +Frontend attach headers +*** + +.. Keep it on alphabetic order + +.. kernel-doc:: drivers/media/dvb-frontends/a8293.h +.. kernel-doc:: drivers/media/dvb-frontends/af9013.h +.. kernel-doc:: drivers/media/dvb-frontends/ascot2e.h +.. kernel-doc:: drivers/media/dvb-frontends/cxd2820r.h +.. kernel-doc:: drivers/media/dvb-frontends/drxk.h +.. kernel-doc:: drivers/media/dvb-frontends/dvb-pll.h +.. kernel-doc:: drivers/media/dvb-frontends/helene.h +.. kernel-doc:: drivers/media/dvb-frontends/horus3a.h +.. kernel-doc:: drivers/media/dvb-frontends/ix2505v.h +.. kernel-doc:: drivers/media/dvb-frontends/m88ds3103.h +.. kernel-doc:: drivers/media/dvb-frontends/mb86a20s.h +.. kernel-doc:: drivers/media/dvb-frontends/mn88472.h +.. kernel-doc:: drivers/media/dvb-frontends/rtl2830.h +.. kernel-doc:: drivers/media/dvb-frontends/rtl2832.h +.. kernel-doc:: drivers/media/dvb-frontends/rtl2832_sdr.h +.. kernel-doc:: drivers/media/dvb-frontends/stb6000.h +.. kernel-doc:: drivers/media/dvb-frontends/tda10071.h +.. kernel-doc:: drivers/media/dvb-frontends/tda826x.h +.. kernel-doc:: drivers/media/dvb-frontends/zd1301_demod.h +.. kernel-doc:: drivers/media/dvb-frontends/zl10036.h + diff --git a/Documentation/media/dvb-drivers/index.rst b/Documentation/media/dvb-drivers/index.rst index 376141143ae9..314e127d82e3 100644 --- a/Documentation/media/dvb-drivers/index.rst +++ b/Documentation/media/dvb-drivers/index.rst @@ -41,4 +41,5 @@ For more details see the file COPYING in the source distribution of Linux. technisat ttusb-dec udev + frontends contributors -- 2.14.3
[PATCH v2 01/10] media: rc: gpio-ir-recv: use helper vaiable to acess device info
Using explicit struct device variable makes code a bit more readable. Signed-off-by: Ladislav Michl--- Changes: -v2: rebased to current linux.git drivers/media/rc/gpio-ir-recv.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 7248b3662285..741a68c192ce 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -95,18 +95,18 @@ static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) static int gpio_ir_recv_probe(struct platform_device *pdev) { + struct device *dev = >dev; struct gpio_rc_dev *gpio_dev; struct rc_dev *rcdev; - const struct gpio_ir_recv_platform_data *pdata = - pdev->dev.platform_data; + const struct gpio_ir_recv_platform_data *pdata = dev->platform_data; int rc; if (pdev->dev.of_node) { struct gpio_ir_recv_platform_data *dtpdata = - devm_kzalloc(>dev, sizeof(*dtpdata), GFP_KERNEL); + devm_kzalloc(dev, sizeof(*dtpdata), GFP_KERNEL); if (!dtpdata) return -ENOMEM; - rc = gpio_ir_recv_get_devtree_pdata(>dev, dtpdata); + rc = gpio_ir_recv_get_devtree_pdata(dev, dtpdata); if (rc) return rc; pdata = dtpdata; @@ -135,7 +135,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rcdev->input_id.vendor = 0x0001; rcdev->input_id.product = 0x0001; rcdev->input_id.version = 0x0100; - rcdev->dev.parent = >dev; + rcdev->dev.parent = dev; rcdev->driver_name = GPIO_IR_DRIVER_NAME; rcdev->min_timeout = 1; rcdev->timeout = IR_DEFAULT_TIMEOUT; @@ -159,7 +159,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rc = rc_register_device(rcdev); if (rc < 0) { - dev_err(>dev, "failed to register rc device\n"); + dev_err(dev, "failed to register rc device (%d)\n", rc); goto err_register_rc_device; } -- 2.11.0
[PATCH 01/10] media: rc: gpio-ir-recv: use helper vaiable to acess device info
Using explicit struct device variable makes code a bit more readable. Signed-off-by: Ladislav Michl--- drivers/media/rc/gpio-ir-recv.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index b4f773b9dc1d..2f6233186ce9 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -116,18 +116,18 @@ static void flush_timer(unsigned long arg) static int gpio_ir_recv_probe(struct platform_device *pdev) { + struct device *dev = >dev; struct gpio_rc_dev *gpio_dev; struct rc_dev *rcdev; - const struct gpio_ir_recv_platform_data *pdata = - pdev->dev.platform_data; + const struct gpio_ir_recv_platform_data *pdata = dev->platform_data; int rc; if (pdev->dev.of_node) { struct gpio_ir_recv_platform_data *dtpdata = - devm_kzalloc(>dev, sizeof(*dtpdata), GFP_KERNEL); + devm_kzalloc(dev, sizeof(*dtpdata), GFP_KERNEL); if (!dtpdata) return -ENOMEM; - rc = gpio_ir_recv_get_devtree_pdata(>dev, dtpdata); + rc = gpio_ir_recv_get_devtree_pdata(dev, dtpdata); if (rc) return rc; pdata = dtpdata; @@ -156,7 +156,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rcdev->input_id.vendor = 0x0001; rcdev->input_id.product = 0x0001; rcdev->input_id.version = 0x0100; - rcdev->dev.parent = >dev; + rcdev->dev.parent = dev; rcdev->driver_name = GPIO_IR_DRIVER_NAME; rcdev->min_timeout = 1; rcdev->timeout = IR_DEFAULT_TIMEOUT; @@ -183,7 +183,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rc = rc_register_device(rcdev); if (rc < 0) { - dev_err(>dev, "failed to register rc device\n"); + dev_err(dev, "failed to register rc device\n"); goto err_register_rc_device; } -- 2.11.0
[PATCH 1/9] i2c: mux: provide more info on failure in i2c_mux_add_adapter
No callers then need to report any further info, thus reducing both the amount of code and the log noise. Signed-off-by: Peter Rosin <p...@axentia.se> --- drivers/i2c/i2c-mux.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 2178266bca79..26f7237558ba 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -395,13 +395,16 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, if (force_nr) { priv->adap.nr = force_nr; ret = i2c_add_numbered_adapter(>adap); + dev_err(>dev, + "failed to add mux-adapter %u as bus %u (error=%d)\n", + chan_id, force_nr, ret); } else { ret = i2c_add_adapter(>adap); + dev_err(>dev, + "failed to add mux-adapter %u (error=%d)\n", + chan_id, ret); } if (ret < 0) { - dev_err(>dev, - "failed to add mux-adapter (error=%d)\n", - ret); kfree(priv); return ret; } -- 2.1.4
[PATCH for v4.10 1/6] cec: when canceling a message, don't overwrite old status info
From: Hans Verkuil <hansv...@cisco.com> When a pending message was canceled (e.g. due to a timeout), then the old tx_status info was overwritten instead of ORed. The same happened with the tx_error_cnt field. So just modify them instead of overwriting them. Signed-off-by: Hans Verkuil <hans.verk...@cisco.com> --- drivers/media/cec/cec-adap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c index f15f6ff..3191c0c 100644 --- a/drivers/media/cec/cec-adap.c +++ b/drivers/media/cec/cec-adap.c @@ -288,10 +288,10 @@ static void cec_data_cancel(struct cec_data *data) /* Mark it as an error */ data->msg.tx_ts = ktime_get_ns(); - data->msg.tx_status = CEC_TX_STATUS_ERROR | - CEC_TX_STATUS_MAX_RETRIES; + data->msg.tx_status |= CEC_TX_STATUS_ERROR | + CEC_TX_STATUS_MAX_RETRIES; + data->msg.tx_error_cnt++; data->attempts = 0; - data->msg.tx_error_cnt = 1; /* Queue transmitted message for monitoring purposes */ cec_queue_msg_monitor(data->adap, >msg, 1); -- 2.10.2 -- 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] [media] v4l: vsp1: Fix format-info documentation
Hi Kieran, Thank you for the patch. On Thursday 09 Jun 2016 18:57:02 Kieran Bingham wrote: > Minor tweaks to document the swap register and make the documentation > match the struct ordering > > Signed-off-by: Kieran Bingham <kie...@bingham.xyz> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> and applied to my tree. > --- > drivers/media/platform/vsp1/vsp1_pipe.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h > b/drivers/media/platform/vsp1/vsp1_pipe.h index 7b56113511dd..6ee3db1fab55 > 100644 > --- a/drivers/media/platform/vsp1/vsp1_pipe.h > +++ b/drivers/media/platform/vsp1/vsp1_pipe.h > @@ -25,11 +25,12 @@ struct vsp1_rwpf; > > /* > * struct vsp1_format_info - VSP1 video format description > - * @mbus: media bus format code > * @fourcc: V4L2 pixel format FCC identifier > + * @mbus: media bus format code > + * @hwfmt: VSP1 hardware format > + * @swap: swap register control > * @planes: number of planes > * @bpp: bits per pixel > - * @hwfmt: VSP1 hardware format > * @swap_yc: the Y and C components are swapped (Y comes before C) > * @swap_uv: the U and V components are swapped (V comes before U) > * @hsub: horizontal subsampling factor -- 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 3/3] [media] v4l2-ioctl.h add debug info for struct v4l2_ioctl_ops
ointer to the function that implements + * :ref:`VIDIOC_UNSUBSCRIBE_EVENT ` ioctl + * @vidioc_default: pointed used to allow other ioctls + */ struct v4l2_ioctl_ops { /* ioctl callbacks */ -- 2.7.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
Re: [PATCH] media: s5p-mfc fix vidioc_g_crop() to return crop info.
On 06/30/2016 01:33 AM, Shuah Khan wrote: > Fix vidioc_g_crop() to report crop information irrepective of ctx state. > g_crop is expected to return crop information as long as the passed in > v4l2_crop type field is vV4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE. > > Signed-off-by: Shuah Khan <shua...@osg.samsung.com> > --- > drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > index a01a373..4ace9e1 100644 > --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > @@ -774,12 +774,9 @@ static int vidioc_g_crop(struct file *file, void *priv, > struct s5p_mfc_dev *dev = ctx->dev; > u32 left, right, top, bottom; > > - if (ctx->state != MFCINST_HEAD_PARSED && > - ctx->state != MFCINST_RUNNING && ctx->state != MFCINST_FINISHING > - && ctx->state != MFCINST_FINISHED) { > - mfc_err("Cannont set crop\n"); > - return -EINVAL; > - } Well, without this information all you can do is to return a fake rectangle. The decoder needs to have parsed the header to know the size. > + if (cr->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) Actually, this should be V4L2_BUF_TYPE_VIDEO_OUTPUT. See the spec. I actually wonder why there is a g_crop at all since without a s_crop it doesn't provide any useful information. And if it is needed, then g_selection is the right callback since g_crop for output provides the compose rectangle, not the crop rectangle (one of the reasons we introduced g/s_selection). Regards, Hans > + return -EINVAL; > + > if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_H264) { > left = s5p_mfc_hw_call(dev->mfc_ops, get_crop_info_h, ctx); > right = left >> S5P_FIMV_SHARED_CROP_RIGHT_SHIFT; > -- 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: s5p-mfc fix vidioc_g_crop() to return crop info.
Fix vidioc_g_crop() to report crop information irrepective of ctx state. g_crop is expected to return crop information as long as the passed in v4l2_crop type field is vV4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE. Signed-off-by: Shuah Khan <shua...@osg.samsung.com> --- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index a01a373..4ace9e1 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -774,12 +774,9 @@ static int vidioc_g_crop(struct file *file, void *priv, struct s5p_mfc_dev *dev = ctx->dev; u32 left, right, top, bottom; - if (ctx->state != MFCINST_HEAD_PARSED && - ctx->state != MFCINST_RUNNING && ctx->state != MFCINST_FINISHING - && ctx->state != MFCINST_FINISHED) { - mfc_err("Cannont set crop\n"); - return -EINVAL; - } + if (cr->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + return -EINVAL; + if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_H264) { left = s5p_mfc_hw_call(dev->mfc_ops, get_crop_info_h, ctx); right = left >> S5P_FIMV_SHARED_CROP_RIGHT_SHIFT; -- 2.7.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
[PATCH] [media] v4l: vsp1: Fix format-info documentation
Minor tweaks to document the swap register and make the documentation match the struct ordering Signed-off-by: Kieran Bingham <kie...@bingham.xyz> --- drivers/media/platform/vsp1/vsp1_pipe.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h b/drivers/media/platform/vsp1/vsp1_pipe.h index 7b56113511dd..6ee3db1fab55 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.h +++ b/drivers/media/platform/vsp1/vsp1_pipe.h @@ -25,11 +25,12 @@ struct vsp1_rwpf; /* * struct vsp1_format_info - VSP1 video format description - * @mbus: media bus format code * @fourcc: V4L2 pixel format FCC identifier + * @mbus: media bus format code + * @hwfmt: VSP1 hardware format + * @swap: swap register control * @planes: number of planes * @bpp: bits per pixel - * @hwfmt: VSP1 hardware format * @swap_yc: the Y and C components are swapped (Y comes before C) * @swap_uv: the U and V components are swapped (V comes before U) * @hsub: horizontal subsampling factor -- 2.7.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
[PATCH v2 23/32] v4l: vsp1: Move format info to vsp1_pipe.c
_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, true, 2, 2, false }, + { V4L2_PIX_FMT_NV16M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, false, 2, 1, false }, + { V4L2_PIX_FMT_NV61M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, true, 2, 1, false }, + { V4L2_PIX_FMT_YUV420M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_U_V_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 3, { 8, 8, 8 }, false, false, 2, 2, false }, +}; + +/* + * vsp1_get_format_info - Retrieve format information for a 4CC + * @fourcc: the format 4CC + * + * Return a pointer to the format information structure corresponding to the + * given V4L2 format 4CC, or NULL if no corresponding format can be found. + */ +const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(vsp1_video_formats); ++i) { + const struct vsp1_format_info *info = _video_formats[i]; + + if (info->fourcc == fourcc) + return info; + } + + return NULL; +} + +/* - * Pipeline Management */ diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h b/drivers/media/platform/vsp1/vsp1_pipe.h index 9c8ded1c29f6..f9035c739e9a 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.h +++ b/drivers/media/platform/vsp1/vsp1_pipe.h @@ -21,6 +21,33 @@ struct vsp1_rwpf; +/* + * struct vsp1_format_info - VSP1 video format description + * @mbus: media bus format code + * @fourcc: V4L2 pixel format FCC identifier + * @planes: number of planes + * @bpp: bits per pixel + * @hwfmt: VSP1 hardware format + * @swap_yc: the Y and C components are swapped (Y comes before C) + * @swap_uv: the U and V components are swapped (V comes before U) + * @hsub: horizontal subsampling factor + * @vsub: vertical subsampling factor + * @alpha: has an alpha channel + */ +struct vsp1_format_info { + u32 fourcc; + unsigned int mbus; + unsigned int hwfmt; + unsigned int swap; + unsigned int planes; + unsigned int bpp[3]; + bool swap_yc; + bool swap_uv; + unsigned int hsub; + unsigned int vsub; + bool alpha; +}; + enum vsp1_pipeline_state { VSP1_PIPELINE_STOPPED, VSP1_PIPELINE_RUNNING, @@ -97,4 +124,6 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe, void vsp1_pipelines_suspend(struct vsp1_device *vsp1); void vsp1_pipelines_resume(struct vsp1_device *vsp1); +const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc); + #endif /* __VSP1_PIPE_H__ */ diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index a9b7bafc5fa2..141e489a8aa9 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -48,113 +48,6 @@ * Helper functions */ -static const struct vsp1_format_info vsp1_video_formats[] = { - { V4L2_PIX_FMT_RGB332, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_332, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, - 1, { 8, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_ARGB444, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_ARGB_, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB444, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_XRGB_, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_ARGB555, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_ARGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB555, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_XRGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB565, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_565, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_BGR24, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_BGR_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, - 1, { 24, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB24, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_88
[PATCH 9/9] media: rc: nuvoton-cir: switch chip detection message to info level
Switch the info about the detected chip type from debug to info level as it might be useful not only for debugging purposes. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/media/rc/nuvoton-cir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 1ba9c99..18adf58 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -278,8 +278,9 @@ static void nvt_hw_detect(struct nvt_dev *nvt) "unknown chip, id: 0x%02x 0x%02x, it may not work...", nvt->chip_major, nvt->chip_minor); else - nvt_dbg("found %s or compatible: chip id: 0x%02x 0x%02x", - chip_name, nvt->chip_major, nvt->chip_minor); + dev_info(>pdev->dev, +"found %s or compatible: chip id: 0x%02x 0x%02x", +chip_name, nvt->chip_major, nvt->chip_minor); nvt_efm_disable(nvt); } -- 2.6.2 -- 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
[PATCHv5 13/13] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR
Add SDR specific notes to G_MODULATOR / S_MODULATOR documentation. Signed-off-by: Antti Palosaari <cr...@iki.fi> --- Documentation/DocBook/media/v4l/vidioc-g-modulator.xml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml index 80167fc..e83f1a3 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml @@ -78,6 +78,12 @@ different audio modulation if the request cannot be satisfied. However this is a write-only ioctl, it does not return the actual audio modulation selected. +SDR specific modulator types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +For SDR devices txsubchans field must be +initialized to zero. +The term modulator means SDR transmitter in this context. + To change the radio frequency the ioctl is available. -- http://palosaari.fi/ -- 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
[PATCHv5 12/13] DocBook: add SDR specific info to G_TUNER / S_TUNER
Add SDR specific notes to G_TUNER / S_TUNER documentation. Add V4L2_TUNER_SDR and V4L2_TUNER_RF to supported tuner types to table. Signed-off-by: Antti Palosaari <cr...@iki.fi> --- Documentation/DocBook/media/v4l/vidioc-g-tuner.xml | 16 1 file changed, 16 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index b0d8659..ae34bdd 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml @@ -80,6 +80,12 @@ if the requested mode is invalid or unsupported. Since this is a write-only ioctl, it does not return the actually selected audio mode. +SDR specific tuner types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +For SDR devices audmode field must be +initialized to zero. +The term tuner means SDR receiver in this context. + To change the radio frequency the ioctl is available. @@ -261,6 +267,16 @@ applications must set the array to zero. 2 + + V4L2_TUNER_SDR + 4 + + + + V4L2_TUNER_RF + 5 + + -- http://palosaari.fi/ -- 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 23/32] v4l: vsp1: Move format info to vsp1_pipe.c
_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, true, 2, 2, false }, + { V4L2_PIX_FMT_NV16M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, false, 2, 1, false }, + { V4L2_PIX_FMT_NV61M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 2, { 8, 16, 0 }, false, true, 2, 1, false }, + { V4L2_PIX_FMT_YUV420M, MEDIA_BUS_FMT_AYUV8_1X32, + VI6_FMT_Y_U_V_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | + VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, + 3, { 8, 8, 8 }, false, false, 2, 2, false }, +}; + +/* + * vsp1_get_format_info - Retrieve format information for a 4CC + * @fourcc: the format 4CC + * + * Return a pointer to the format information structure corresponding to the + * given V4L2 format 4CC, or NULL if no corresponding format can be found. + */ +const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(vsp1_video_formats); ++i) { + const struct vsp1_format_info *info = _video_formats[i]; + + if (info->fourcc == fourcc) + return info; + } + + return NULL; +} + +/* - * Pipeline Management */ diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h b/drivers/media/platform/vsp1/vsp1_pipe.h index 9c8ded1c29f6..f9035c739e9a 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.h +++ b/drivers/media/platform/vsp1/vsp1_pipe.h @@ -21,6 +21,33 @@ struct vsp1_rwpf; +/* + * struct vsp1_format_info - VSP1 video format description + * @mbus: media bus format code + * @fourcc: V4L2 pixel format FCC identifier + * @planes: number of planes + * @bpp: bits per pixel + * @hwfmt: VSP1 hardware format + * @swap_yc: the Y and C components are swapped (Y comes before C) + * @swap_uv: the U and V components are swapped (V comes before U) + * @hsub: horizontal subsampling factor + * @vsub: vertical subsampling factor + * @alpha: has an alpha channel + */ +struct vsp1_format_info { + u32 fourcc; + unsigned int mbus; + unsigned int hwfmt; + unsigned int swap; + unsigned int planes; + unsigned int bpp[3]; + bool swap_yc; + bool swap_uv; + unsigned int hsub; + unsigned int vsub; + bool alpha; +}; + enum vsp1_pipeline_state { VSP1_PIPELINE_STOPPED, VSP1_PIPELINE_RUNNING, @@ -97,4 +124,6 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe, void vsp1_pipelines_suspend(struct vsp1_device *vsp1); void vsp1_pipelines_resume(struct vsp1_device *vsp1); +const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc); + #endif /* __VSP1_PIPE_H__ */ diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 589ce49e8688..e0d4f84bc26d 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -48,113 +48,6 @@ * Helper functions */ -static const struct vsp1_format_info vsp1_video_formats[] = { - { V4L2_PIX_FMT_RGB332, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_332, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, - 1, { 8, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_ARGB444, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_ARGB_, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB444, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_XRGB_, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_ARGB555, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_ARGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB555, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_XRGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB565, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_565, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS, - 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_BGR24, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_BGR_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | - VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, - 1, { 24, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB24, MEDIA_BUS_FMT_ARGB_1X32, - VI6_FMT_RGB_88
Re: [PATCH 13/13] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR
On 09/01/2015 11:59 PM, Antti Palosaari wrote: > Add SDR specific notes to G_MODULATOR / S_MODULATOR documentation. > > Signed-off-by: Antti Palosaari <cr...@iki.fi> > --- > Documentation/DocBook/media/v4l/vidioc-g-modulator.xml | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml > b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml > index 80167fc..affb694 100644 > --- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml > +++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml > @@ -78,6 +78,15 @@ different audio modulation if the request cannot be > satisfied. However > this is a write-only ioctl, it does not return the actual audio > modulation selected. > > +SDR specific modulator types are > +V4L2_TUNER_SDR and V4L2_TUNER_RF. > +Valid fields for these modulator types are index, > +name, capability, > +rangelow, rangehigh > +and type. All the rest fields must be s/rest/remaining/ > +initialized to zero by both application and driver. I would drop this sentence. The spec is clear about which fields have to be set by the user. The only thing I would mention here is that txsubchans should be initialized to 0 by applications (we might want to use it in the future) when calling S_MODULATOR. For S_TUNER it is the same: only mention that audmode should be initialized to 0 for these SDR tuner types. > +Term modulator means SDR transmitter on this context. s/Term/The term/ s/on/in/ Note: the same typos are in patch 12/13. Perhaps this sentence should be rewritten since it is not clear what you mean. I guess the idea is that 'modulator' is not a good match to what actually happens in the SDR hardware? How about: "Note that the term 'modulator' is a misnomer for type V4L2_TUNER_SDR since this really is a DAC and the 'modulator' frequency is in reality the sampling frequency of the DAC." I hope I got that right. And do something similar for patch 12/13. > + > To change the radio frequency the ioctl > is available. > > Regards, Hans -- 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 13/13] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR
On 09/04/2015 01:26 PM, Hans Verkuil wrote: On 09/01/2015 11:59 PM, Antti Palosaari wrote: Add SDR specific notes to G_MODULATOR / S_MODULATOR documentation. Signed-off-by: Antti Palosaari <cr...@iki.fi> --- Documentation/DocBook/media/v4l/vidioc-g-modulator.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml index 80167fc..affb694 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml @@ -78,6 +78,15 @@ different audio modulation if the request cannot be satisfied. However this is a write-only ioctl, it does not return the actual audio modulation selected. +SDR specific modulator types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +Valid fields for these modulator types are index, +name, capability, +rangelow, rangehigh +and type. All the rest fields must be s/rest/remaining/ +initialized to zero by both application and driver. I would drop this sentence. The spec is clear about which fields have to be set by the user. The only thing I would mention here is that txsubchans should be initialized to 0 by applications (we might want to use it in the future) when calling S_MODULATOR. For S_TUNER it is the same: only mention that audmode should be initialized to 0 for these SDR tuner types. +Term modulator means SDR transmitter on this context. s/Term/The term/ s/on/in/ Note: the same typos are in patch 12/13. Perhaps this sentence should be rewritten since it is not clear what you mean. I guess the idea is that 'modulator' is not a good match to what actually happens in the SDR hardware? How about: "Note that the term 'modulator' is a misnomer for type V4L2_TUNER_SDR since this really is a DAC and the 'modulator' frequency is in reality the sampling frequency of the DAC." I hope I got that right. And do something similar for patch 12/13. I added it mainly because struct v4l2_modulator is somehow misleading as it contains both modulator and RF frontend specific stuff and especially misleading for SDR case as modulator is located in a host computer software. On DVB side modulator/demodulator and tuner are split more correctly. If you look that struct v4l2_modulator: index: common field name: common field capability: contains both RF frontend and modulator stuff rangelow: RF frontend specific rangehigh: RF frontend specific txsubchans: modulator specific type: common field reserved: reserved So actually most field on that struct v4l2_modulator are RF frontend specific, not modulator. Same applies to struct v4l2_tuner. These should be probably: tuner => receiver modulator => transmitter Or even better, like DVB side, split modulator/demodulator and RF stuff to own structs. But as it is not reasonable to start changing those, so I decided to add comment for tuner that it means SDR receiver and for modulator it means SDR transmitter. regards Antti + To change the radio frequency the ioctl is available. Regards, Hans -- http://palosaari.fi/ -- 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 13/13] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR
Add SDR specific notes to G_MODULATOR / S_MODULATOR documentation. Signed-off-by: Antti Palosaari <cr...@iki.fi> --- Documentation/DocBook/media/v4l/vidioc-g-modulator.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml index 80167fc..affb694 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml @@ -78,6 +78,15 @@ different audio modulation if the request cannot be satisfied. However this is a write-only ioctl, it does not return the actual audio modulation selected. +SDR specific modulator types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +Valid fields for these modulator types are index, +name, capability, +rangelow, rangehigh +and type. All the rest fields must be +initialized to zero by both application and driver. +Term modulator means SDR transmitter on this context. + To change the radio frequency the ioctl is available. -- http://palosaari.fi/ -- 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 12/13] DocBook: add SDR specific info to G_TUNER / S_TUNER
Add SDR specific notes to G_TUNER / S_TUNER documentation. Add V4L2_TUNER_SDR and V4L2_TUNER_RF to supported tuner types to table. Signed-off-by: Antti Palosaari <cr...@iki.fi> --- Documentation/DocBook/media/v4l/vidioc-g-tuner.xml | 19 +++ 1 file changed, 19 insertions(+) diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index b0d8659..0140c08 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml @@ -80,6 +80,15 @@ if the requested mode is invalid or unsupported. Since this is a write-only ioctl, it does not return the actually selected audio mode. +SDR specific tuner types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +Valid fields for these tuner types are index, +name, type, +capability, rangelow +and rangehigh. All the rest fields must be +initialized to zero by both application and driver. +Term tuner means SDR receiver on this context. + To change the radio frequency the ioctl is available. @@ -261,6 +270,16 @@ applications must set the array to zero. 2 + + V4L2_TUNER_SDR + 4 + + + + V4L2_TUNER_RF + 5 + + -- http://palosaari.fi/ -- 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
Meld je nu aan voor meer info / Apply now for more info
Head Office Adres: 16 Hanover Square, Mayfair, Londen W1S 1HT Branch Adres: PO Box 20517 CY-3058 Limassol, Istanbul, Turkije e-mail:standardloansplccomany...@gmail.com Heeft u financiering nodig? Heeft u zakelijke of persoonlijke lening nodig? Wilt u uw bedrijf te herfinancieren? Ons bedrijf is gevestigd in de Verenigde Staten en Europa. We geven lening aan een individu en onderneming op 3% rente per jaar. Opmerking: Stuur uw reactie Alleen op deze E-mail: standardloansplccomany...@gmail.com === Do you need funding? Do you need Business or personal Loan? Do you wish to refinance your company? Our company is based in United States and Europe. We give out loan to any individual and company at 3% interest rate yearly. Note : Forward your response ONLY to this Email: standardloansplccomany...@gmail.com -- 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] bdisp: fix debug info memory access
bdisp_dev-dbg.copy_node shall be a copy of (and not point to) bdisp_ctx-node, since this resource is freed upon driver release. Signed-off-by: Fabien Dessenne fabien.desse...@st.com --- drivers/media/platform/sti/bdisp/bdisp-hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-hw.c b/drivers/media/platform/sti/bdisp/bdisp-hw.c index c83f9c2..052c932 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-hw.c +++ b/drivers/media/platform/sti/bdisp/bdisp-hw.c @@ -768,12 +768,12 @@ static void bdisp_hw_save_request(struct bdisp_ctx *ctx) /* Allocate memory if not done yet */ if (!copy_node[i]) { copy_node[i] = devm_kzalloc(ctx-bdisp_dev-dev, - sizeof(*copy_node), + sizeof(*copy_node[i]), GFP_KERNEL); if (!copy_node[i]) return; } - copy_node[i] = node[i]; + *copy_node[i] = *node[i]; } } -- 1.9.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 2/2] [media] bdisp: add debug info for RGB24 format
Add this missing debug information Signed-off-by: Fabien Dessenne fabien.desse...@st.com --- drivers/media/platform/sti/bdisp/bdisp-debug.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/sti/bdisp/bdisp-debug.c b/drivers/media/platform/sti/bdisp/bdisp-debug.c index 18282a0..79c5635 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-debug.c +++ b/drivers/media/platform/sti/bdisp/bdisp-debug.c @@ -116,6 +116,9 @@ static void bdisp_dbg_dump_tty(struct seq_file *s, u32 val) case BDISP_RGB565: seq_puts(s, RGB565 - ); break; + case BDISP_RGB888: + seq_puts(s, RGB888 - ); + break; case BDISP_XRGB: seq_puts(s, xRGB888 - ); break; @@ -185,6 +188,9 @@ static void bdisp_dbg_dump_sty(struct seq_file *s, case BDISP_RGB565: seq_puts(s, RGB565 - ); break; + case BDISP_RGB888: + seq_puts(s, RGB888 - ); + break; case BDISP_XRGB: seq_puts(s, xRGB888 - ); break; @@ -420,6 +426,8 @@ static const char *bdisp_fmt_to_str(struct bdisp_frame frame) return NV12; case V4L2_PIX_FMT_RGB565: return RGB16; + case V4L2_PIX_FMT_RGB24: + return RGB24; case V4L2_PIX_FMT_XBGR32: return XRGB; case V4L2_PIX_FMT_ABGR32: -- 1.9.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 04/15] media: adv7604: chip info and formats for ADV7612
, + }, + .num_recommended_settings = { + [1] = ARRAY_SIZE(adv7612_recommended_settings_hdmi), + }, + .page_mask = BIT(ADV76XX_PAGE_IO) | BIT(ADV76XX_PAGE_CEC) | + BIT(ADV76XX_PAGE_INFOFRAME) | BIT(ADV76XX_PAGE_AFE) | + BIT(ADV76XX_PAGE_REP) | BIT(ADV76XX_PAGE_EDID) | + BIT(ADV76XX_PAGE_HDMI) | BIT(ADV76XX_PAGE_CP), + .linewidth_mask = 0x1fff, + .field0_height_mask = 0x1fff, + .field1_height_mask = 0x1fff, + .hfrontporch_mask = 0x1fff, + .hsync_mask = 0x1fff, + .hbackporch_mask = 0x1fff, + .field0_vfrontporch_mask = 0x3fff, + .field0_vsync_mask = 0x3fff, + .field0_vbackporch_mask = 0x3fff, + .field1_vfrontporch_mask = 0x3fff, + .field1_vsync_mask = 0x3fff, + .field1_vbackporch_mask = 0x3fff, + }, }; static const struct i2c_device_id adv76xx_i2c_id[] = { { adv7604, (kernel_ulong_t)adv76xx_chip_info[ADV7604] }, { adv7611, (kernel_ulong_t)adv76xx_chip_info[ADV7611] }, + { adv7612, (kernel_ulong_t)adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(i2c, adv76xx_i2c_id); static const struct of_device_id adv76xx_of_id[] __maybe_unused = { { .compatible = adi,adv7611, .data = adv76xx_chip_info[ADV7611] }, + { .compatible = adi,adv7612, .data = adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(of, adv76xx_of_id); @@ -2840,21 +2929,26 @@ static int adv76xx_probe(struct i2c_client *client, * identifies the revision, while on ADV7611 it identifies the model as * well. Use the HDMI slave address on ADV7604 and RD_INFO on ADV7611. */ - if (state-info-type == ADV7604) { + switch (state-info-type) { + case ADV7604: val = adv_smbus_read_byte_data_check(client, 0xfb, false); if (val != 0x68) { v4l2_info(sd, not an adv7604 on address 0x%x\n, client-addr 1); return -ENODEV; } - } else { + break; + case ADV7611: + case ADV7612: val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, client-addr 1); return -ENODEV; } + break; } /* control handlers */ -- 1.7.10.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
Re: [PATCH 01/14] sh-veu: initialize timestamp_flags and copy timestamp info
On Mon, 15 Jun 2015, Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com This field wasn't set, causing WARN_ON's from the vb2 core. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Thanks Guennadi --- drivers/media/platform/sh_veu.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index 2554f37..77a74d3 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -958,6 +958,7 @@ static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, src_vq-ops = sh_veu_qops; src_vq-mem_ops = vb2_dma_contig_memops; src_vq-lock = veu-fop_lock; + src_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; ret = vb2_queue_init(src_vq); if (ret 0) @@ -971,6 +972,7 @@ static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq-ops = sh_veu_qops; dst_vq-mem_ops = vb2_dma_contig_memops; dst_vq-lock = veu-fop_lock; + dst_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; return vb2_queue_init(dst_vq); } @@ -1103,6 +1105,12 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id) if (!src || !dst) return IRQ_NONE; + dst-v4l2_buf.timestamp = src-v4l2_buf.timestamp; + dst-v4l2_buf.flags = ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; + dst-v4l2_buf.flags |= + src-v4l2_buf.flags V4L2_BUF_FLAG_TSTAMP_SRC_MASK; + dst-v4l2_buf.timecode = src-v4l2_buf.timecode; + spin_lock(veu-lock); v4l2_m2m_buf_done(src, VB2_BUF_STATE_DONE); v4l2_m2m_buf_done(dst, VB2_BUF_STATE_DONE); -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-media in
Re: [PATCH] au0828: Cache the decoder info at au0828 dev structure
On 06/18/2015 06:09 PM, Mauro Carvalho Chehab wrote: Instead of seeking for the decoder every time analog stream is started, cache it. Requested-by: Hans Verkuil hverk...@xs4all.nl Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com --- drivers/media/usb/au0828/au0828-video.c | 37 ++--- drivers/media/usb/au0828/au0828.h | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 4ebe13673adf..5f6e2aaad222 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -641,32 +641,35 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev = dev-media_dev; - struct media_entity *entity, *decoder = NULL, *source; + struct media_entity *entity, *source; struct media_link *link, *found_link = NULL; int i, ret, active_links = 0; if (!mdev) return 0; - /* - * This will find the tuner that is connected into the decoder. - * Technically, this is not 100% correct, as the device may be - * using an analog input instead of the tuner. However, as we can't - * do DVB streaming while the DMA engine is being used for V4L2, - * this should be enough for the actual needs. - */ - media_device_for_each_entity(entity, mdev) { - if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { - decoder = entity; - break; + if (!dev-decoder) { + /* + * This will find the tuner that is connected into the decoder. + * Technically, this is not 100% correct, as the device may be + * using an analog input instead of the tuner. However, as we + * can't do DVB streaming while the DMA engine is being used for + * V4L2, this should be enough for the actual needs. + */ + media_device_for_each_entity(entity, mdev) { + if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { + dev-decoder = entity; + break; + } No, this is still searching unnecessary. Look in au0828_card_analog_fe_setup(), which is where the au8522 is loaded (and that's the only decoder used by this driver): just store the sd-entity pointer in the decoder field and you're done. You can drop this whole 'if (!dev-decoder)' part here. BTW, the comment in the 'if' block belongs to 'for' loop below. Regards, Hans } + + if (!dev-decoder) + return 0; } - if (!decoder) - return 0; - for (i = 0; i decoder-num_links; i++) { - link = decoder-links[i]; - if (link-sink-entity == decoder) { + for (i = 0; i dev-decoder-num_links; i++) { + link = dev-decoder-links[i]; + if (link-sink-entity == dev-decoder) { found_link = link; if (link-flags MEDIA_LNK_FL_ENABLED) active_links++; diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 7e6a3bbc68ab..d3644b3fe6fa 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -280,6 +280,7 @@ struct au0828_dev { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *media_dev; struct media_pad video_pad, vbi_pad; + struct media_entity *decoder; #endif }; -- 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] au0828: Cache the decoder info at au0828 dev structure
Instead of seeking for the decoder every time analog stream is started, cache it. Requested-by: Hans Verkuil hverk...@xs4all.nl Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com diff --git a/drivers/media/usb/au0828/au0828-cards.c b/drivers/media/usb/au0828/au0828-cards.c index 6b469e8c4c6e..f7337dbbc59f 100644 --- a/drivers/media/usb/au0828/au0828-cards.c +++ b/drivers/media/usb/au0828/au0828-cards.c @@ -228,6 +228,10 @@ void au0828_card_analog_fe_setup(struct au0828_dev *dev) au8522, 0x8e 1, NULL); if (sd == NULL) pr_err(analog subdev registration failed\n); +#if CONFIG_MEDIA_CONTROLLER + if (sd) + dev-decoder = sd-entity; +#endif } /* Setup tuners */ diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 4ebe13673adf..939b2ad73501 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -641,11 +641,11 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev = dev-media_dev; - struct media_entity *entity, *decoder = NULL, *source; + struct media_entity *entity, *source; struct media_link *link, *found_link = NULL; int i, ret, active_links = 0; - if (!mdev) + if (!mdev || !dev-decoder) return 0; /* @@ -655,18 +655,9 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) * do DVB streaming while the DMA engine is being used for V4L2, * this should be enough for the actual needs. */ - media_device_for_each_entity(entity, mdev) { - if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { - decoder = entity; - break; - } - } - if (!decoder) - return 0; - - for (i = 0; i decoder-num_links; i++) { - link = decoder-links[i]; - if (link-sink-entity == decoder) { + for (i = 0; i dev-decoder-num_links; i++) { + link = dev-decoder-links[i]; + if (link-sink-entity == dev-decoder) { found_link = link; if (link-flags MEDIA_LNK_FL_ENABLED) active_links++; diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 7e6a3bbc68ab..d3644b3fe6fa 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -280,6 +280,7 @@ struct au0828_dev { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *media_dev; struct media_pad video_pad, vbi_pad; + struct media_entity *decoder; #endif }; -- 2.4.3 -- 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] au0828: Cache the decoder info at au0828 dev structure
Instead of seeking for the decoder every time analog stream is started, cache it. Requested-by: Hans Verkuil hverk...@xs4all.nl Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com --- drivers/media/usb/au0828/au0828-video.c | 37 ++--- drivers/media/usb/au0828/au0828.h | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 4ebe13673adf..5f6e2aaad222 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -641,32 +641,35 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev = dev-media_dev; - struct media_entity *entity, *decoder = NULL, *source; + struct media_entity *entity, *source; struct media_link *link, *found_link = NULL; int i, ret, active_links = 0; if (!mdev) return 0; - /* -* This will find the tuner that is connected into the decoder. -* Technically, this is not 100% correct, as the device may be -* using an analog input instead of the tuner. However, as we can't -* do DVB streaming while the DMA engine is being used for V4L2, -* this should be enough for the actual needs. -*/ - media_device_for_each_entity(entity, mdev) { - if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { - decoder = entity; - break; + if (!dev-decoder) { + /* + * This will find the tuner that is connected into the decoder. + * Technically, this is not 100% correct, as the device may be + * using an analog input instead of the tuner. However, as we + * can't do DVB streaming while the DMA engine is being used for + * V4L2, this should be enough for the actual needs. + */ + media_device_for_each_entity(entity, mdev) { + if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { + dev-decoder = entity; + break; + } } + + if (!dev-decoder) + return 0; } - if (!decoder) - return 0; - for (i = 0; i decoder-num_links; i++) { - link = decoder-links[i]; - if (link-sink-entity == decoder) { + for (i = 0; i dev-decoder-num_links; i++) { + link = dev-decoder-links[i]; + if (link-sink-entity == dev-decoder) { found_link = link; if (link-flags MEDIA_LNK_FL_ENABLED) active_links++; diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 7e6a3bbc68ab..d3644b3fe6fa 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -280,6 +280,7 @@ struct au0828_dev { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *media_dev; struct media_pad video_pad, vbi_pad; + struct media_entity *decoder; #endif }; -- 2.4.3 -- 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] [media] au0828: Cache the decoder info at au0828 dev structure
On 06/18/2015 07:27 PM, Mauro Carvalho Chehab wrote: Instead of seeking for the decoder every time analog stream is started, cache it. Requested-by: Hans Verkuil hverk...@xs4all.nl Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com Acked-by: Hans Verkuil hans.verk...@cisco.com Regards, Hans diff --git a/drivers/media/usb/au0828/au0828-cards.c b/drivers/media/usb/au0828/au0828-cards.c index 6b469e8c4c6e..f7337dbbc59f 100644 --- a/drivers/media/usb/au0828/au0828-cards.c +++ b/drivers/media/usb/au0828/au0828-cards.c @@ -228,6 +228,10 @@ void au0828_card_analog_fe_setup(struct au0828_dev *dev) au8522, 0x8e 1, NULL); if (sd == NULL) pr_err(analog subdev registration failed\n); +#if CONFIG_MEDIA_CONTROLLER + if (sd) + dev-decoder = sd-entity; +#endif } /* Setup tuners */ diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 4ebe13673adf..939b2ad73501 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -641,11 +641,11 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *mdev = dev-media_dev; - struct media_entity *entity, *decoder = NULL, *source; + struct media_entity *entity, *source; struct media_link *link, *found_link = NULL; int i, ret, active_links = 0; - if (!mdev) + if (!mdev || !dev-decoder) return 0; /* @@ -655,18 +655,9 @@ static int au0828_enable_analog_tuner(struct au0828_dev *dev) * do DVB streaming while the DMA engine is being used for V4L2, * this should be enough for the actual needs. */ - media_device_for_each_entity(entity, mdev) { - if (entity-type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) { - decoder = entity; - break; - } - } - if (!decoder) - return 0; - - for (i = 0; i decoder-num_links; i++) { - link = decoder-links[i]; - if (link-sink-entity == decoder) { + for (i = 0; i dev-decoder-num_links; i++) { + link = dev-decoder-links[i]; + if (link-sink-entity == dev-decoder) { found_link = link; if (link-flags MEDIA_LNK_FL_ENABLED) active_links++; diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 7e6a3bbc68ab..d3644b3fe6fa 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -280,6 +280,7 @@ struct au0828_dev { #ifdef CONFIG_MEDIA_CONTROLLER struct media_device *media_dev; struct media_pad video_pad, vbi_pad; + struct media_entity *decoder; #endif }; -- 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 01/14] sh-veu: initialize timestamp_flags and copy timestamp info
From: Hans Verkuil hans.verk...@cisco.com This field wasn't set, causing WARN_ON's from the vb2 core. Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/platform/sh_veu.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index 2554f37..77a74d3 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -958,6 +958,7 @@ static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, src_vq-ops = sh_veu_qops; src_vq-mem_ops = vb2_dma_contig_memops; src_vq-lock = veu-fop_lock; + src_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; ret = vb2_queue_init(src_vq); if (ret 0) @@ -971,6 +972,7 @@ static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq-ops = sh_veu_qops; dst_vq-mem_ops = vb2_dma_contig_memops; dst_vq-lock = veu-fop_lock; + dst_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; return vb2_queue_init(dst_vq); } @@ -1103,6 +1105,12 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id) if (!src || !dst) return IRQ_NONE; + dst-v4l2_buf.timestamp = src-v4l2_buf.timestamp; + dst-v4l2_buf.flags = ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; + dst-v4l2_buf.flags |= + src-v4l2_buf.flags V4L2_BUF_FLAG_TSTAMP_SRC_MASK; + dst-v4l2_buf.timecode = src-v4l2_buf.timecode; + spin_lock(veu-lock); v4l2_m2m_buf_done(src, VB2_BUF_STATE_DONE); v4l2_m2m_buf_done(dst, VB2_BUF_STATE_DONE); -- 2.1.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
Re: [PATCH 04/15] media: adv7604: chip info and formats for ADV7612
), + .linewidth_mask = 0x1fff, + .field0_height_mask = 0x1fff, + .field1_height_mask = 0x1fff, + .hfrontporch_mask = 0x1fff, + .hsync_mask = 0x1fff, + .hbackporch_mask = 0x1fff, + .field0_vfrontporch_mask = 0x3fff, + .field0_vsync_mask = 0x3fff, + .field0_vbackporch_mask = 0x3fff, + .field1_vfrontporch_mask = 0x3fff, + .field1_vsync_mask = 0x3fff, + .field1_vbackporch_mask = 0x3fff, + }, }; static const struct i2c_device_id adv76xx_i2c_id[] = { { adv7604, (kernel_ulong_t)adv76xx_chip_info[ADV7604] }, { adv7611, (kernel_ulong_t)adv76xx_chip_info[ADV7611] }, + { adv7612, (kernel_ulong_t)adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(i2c, adv76xx_i2c_id); static const struct of_device_id adv76xx_of_id[] __maybe_unused = { { .compatible = adi,adv7611, .data = adv76xx_chip_info[ADV7611] }, + { .compatible = adi,adv7612, .data = adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(of, adv76xx_of_id); @@ -2801,21 +2879,26 @@ static int adv76xx_probe(struct i2c_client *client, * identifies the revision, while on ADV7611 it identifies the model as * well. Use the HDMI slave address on ADV7604 and RD_INFO on ADV7611. */ - if (state-info-type == ADV7604) { + switch (state-info-type) { + case ADV7604: val = adv_smbus_read_byte_data_check(client, 0xfb, false); if (val != 0x68) { v4l2_info(sd, not an adv7604 on address 0x%x\n, client-addr 1); return -ENODEV; } - } else { + break; + case ADV7611: + case ADV7612: val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, client-addr 1); return -ENODEV; } + break; } /* control handlers */ Regards, Hans -- 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 04/15] media: adv7604: chip info and formats for ADV7612
= 0x1fff, + .hbackporch_mask = 0x1fff, + .field0_vfrontporch_mask = 0x3fff, + .field0_vsync_mask = 0x3fff, + .field0_vbackporch_mask = 0x3fff, + .field1_vfrontporch_mask = 0x3fff, + .field1_vsync_mask = 0x3fff, + .field1_vbackporch_mask = 0x3fff, + }, }; static const struct i2c_device_id adv76xx_i2c_id[] = { { adv7604, (kernel_ulong_t)adv76xx_chip_info[ADV7604] }, { adv7611, (kernel_ulong_t)adv76xx_chip_info[ADV7611] }, + { adv7612, (kernel_ulong_t)adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(i2c, adv76xx_i2c_id); static const struct of_device_id adv76xx_of_id[] __maybe_unused = { { .compatible = adi,adv7611, .data = adv76xx_chip_info[ADV7611] }, + { .compatible = adi,adv7612, .data = adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(of, adv76xx_of_id); @@ -2801,21 +2879,26 @@ static int adv76xx_probe(struct i2c_client *client, * identifies the revision, while on ADV7611 it identifies the model as * well. Use the HDMI slave address on ADV7604 and RD_INFO on ADV7611. */ - if (state-info-type == ADV7604) { + switch (state-info-type) { + case ADV7604: val = adv_smbus_read_byte_data_check(client, 0xfb, false); if (val != 0x68) { v4l2_info(sd, not an adv7604 on address 0x%x\n, client-addr 1); return -ENODEV; } - } else { + break; + case ADV7611: + case ADV7612: val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, client-addr 1); return -ENODEV; } + break; } /* control handlers */ -- 1.7.10.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
[PATCH 04/15] media: adv7604: chip info and formats for ADV7612
= 0x1fff, + .hbackporch_mask = 0x1fff, + .field0_vfrontporch_mask = 0x3fff, + .field0_vsync_mask = 0x3fff, + .field0_vbackporch_mask = 0x3fff, + .field1_vfrontporch_mask = 0x3fff, + .field1_vsync_mask = 0x3fff, + .field1_vbackporch_mask = 0x3fff, + }, }; static const struct i2c_device_id adv76xx_i2c_id[] = { { adv7604, (kernel_ulong_t)adv76xx_chip_info[ADV7604] }, { adv7611, (kernel_ulong_t)adv76xx_chip_info[ADV7611] }, + { adv7612, (kernel_ulong_t)adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(i2c, adv76xx_i2c_id); static const struct of_device_id adv76xx_of_id[] __maybe_unused = { { .compatible = adi,adv7611, .data = adv76xx_chip_info[ADV7611] }, + { .compatible = adi,adv7612, .data = adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(of, adv76xx_of_id); @@ -2811,8 +2889,9 @@ static int adv76xx_probe(struct i2c_client *client, } else { val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, client-addr 1); return -ENODEV; } -- 1.7.10.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
Re: [PATCH 03/20] media: adv7604: chip info and formats for ADV7612
Hi William, Just a nitpick: On Wed, 20 May 2015, William Towle wrote: Add support for the ADV7612 chip as implemented on Renesas' Lager board to adv7604.c, including lists for formats/colourspace/timing selection and an IRQ handler. Signed-off-by: William Towle william.to...@codethink.co.uk --- drivers/media/i2c/adv7604.c | 83 +-- 1 file changed, 81 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index be3f866..a2abb04 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c [snip] @@ -2805,8 +2883,9 @@ static int adv76xx_probe(struct i2c_client *client, } else { val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, A switch / case might look slightly better here. Thanks Guennadi client-addr 1); return -ENODEV; } -- 1.7.10.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
[PATCH 03/20] media: adv7604: chip info and formats for ADV7612
= 0x1fff, + .hbackporch_mask = 0x1fff, + .field0_vfrontporch_mask = 0x3fff, + .field0_vsync_mask = 0x3fff, + .field0_vbackporch_mask = 0x3fff, + .field1_vfrontporch_mask = 0x3fff, + .field1_vsync_mask = 0x3fff, + .field1_vbackporch_mask = 0x3fff, + }, }; static const struct i2c_device_id adv76xx_i2c_id[] = { { adv7604, (kernel_ulong_t)adv76xx_chip_info[ADV7604] }, { adv7611, (kernel_ulong_t)adv76xx_chip_info[ADV7611] }, + { adv7612, (kernel_ulong_t)adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(i2c, adv76xx_i2c_id); static const struct of_device_id adv76xx_of_id[] __maybe_unused = { { .compatible = adi,adv7611, .data = adv76xx_chip_info[ADV7611] }, + { .compatible = adi,adv7612, .data = adv76xx_chip_info[ADV7612] }, { } }; MODULE_DEVICE_TABLE(of, adv76xx_of_id); @@ -2805,8 +2883,9 @@ static int adv76xx_probe(struct i2c_client *client, } else { val = (adv_smbus_read_byte_data_check(client, 0xea, false) 8) | (adv_smbus_read_byte_data_check(client, 0xeb, false) 0); - if (val != 0x2051) { - v4l2_info(sd, not an adv7611 on address 0x%x\n, + if ((state-info-type == ADV7611 val != 0x2051) || + (state-info-type == ADV7612 val != 0x2041)) { + v4l2_info(sd, not an adv761x on address 0x%x\n, client-addr 1); return -ENODEV; } -- 1.7.10.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
[RFC PATCH v2 4/4] adv7842: Use interlaced info for cvt/gtf timing detection
The interlaced information from stdi is passed to detect_cvt/gtf(). Cc: Hans Verkuil hans.verk...@cisco.com Cc: Martin Bugge marbu...@cisco.com Cc: Mats Randgaard matra...@cisco.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/i2c/adv7842.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index b9264f7..8a7c9bd 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -1445,12 +1445,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, timings)) + stdi-interlaced, timings)) return 0; if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, state-aspect_ratio, timings)) + stdi-interlaced, state-aspect_ratio, timings)) return 0; v4l2_dbg(2, debug, sd, -- 1.9.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
[RFC PATCH v2 3/4] adv7604: Use interlaced info for cvt/gtf timing detection
The interlaced information from stdi is passed to detect_cvt/gtf(). These functions now supports timing calculations for interlaced format. Cc: Hans Verkuil hans.verk...@cisco.com Cc: Martin Bugge marbu...@cisco.com Cc: Mats Randgaard matra...@cisco.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/i2c/adv7604.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index f4ecb73..d290f7a 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1323,12 +1323,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, timings)) + stdi-interlaced, timings)) return 0; if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, state-aspect_ratio, timings)) + stdi-interlaced, state-aspect_ratio, timings)) return 0; v4l2_dbg(2, debug, sd, -- 1.9.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
[RFC PATCH v2 2/4] vivid: Use interlaced info for cvt/gtf timing detection
The detect_cvt/gtf() now supports timing calculations for interlaced format. Cc: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/platform/vivid/vivid-vid-cap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c index a99362d..60298c7 100644 --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c @@ -1619,7 +1619,7 @@ static bool valid_cvt_gtf_timings(struct v4l2_dv_timings *timings) if (bt-standards == 0 || (bt-standards V4L2_DV_BT_STD_CVT)) { if (v4l2_detect_cvt(total_v_lines, h_freq, bt-vsync, - bt-polarities, false, timings)) + bt-polarities, bt-interlaced, timings)) return true; } @@ -1630,7 +1630,7 @@ static bool valid_cvt_gtf_timings(struct v4l2_dv_timings *timings) aspect_ratio.numerator, aspect_ratio.denominator); if (v4l2_detect_gtf(total_v_lines, h_freq, bt-vsync, - bt-polarities, false, + bt-polarities, bt-interlaced, aspect_ratio, timings)) return true; } -- 1.9.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
[RFC PATCH 4/4] adv7842: Use interlaced info for cvt/gtf timing detection
The interlaced information from stdi is passed to detect_cvt/gtf(). Cc: Hans Verkuil hans.verk...@cisco.com Cc: Martin Bugge marbu...@cisco.com Cc: Mats Randgaard matra...@cisco.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/i2c/adv7842.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 90cbead..698fe38 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -1333,12 +1333,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, timings)) + stdi-interlaced, timings)) return 0; if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, state-aspect_ratio, timings)) + stdi-interlaced, state-aspect_ratio, timings)) return 0; v4l2_dbg(2, debug, sd, -- 1.9.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
[RFC PATCH 2/4] vivid: Use interlaced info for cvt/gtf timing detection
The detect_cvt/gtf() now supports timing calculations for interlaced format. Cc: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/platform/vivid/vivid-vid-cap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c index a3b19dc..9b76463 100644 --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c @@ -1623,7 +1623,7 @@ static bool valid_cvt_gtf_timings(struct v4l2_dv_timings *timings) if (bt-standards == 0 || (bt-standards V4L2_DV_BT_STD_CVT)) { if (v4l2_detect_cvt(total_v_lines, h_freq, bt-vsync, - bt-polarities, false, timings)) + bt-polarities, bt-interlaced, timings)) return true; } @@ -1634,7 +1634,7 @@ static bool valid_cvt_gtf_timings(struct v4l2_dv_timings *timings) aspect_ratio.numerator, aspect_ratio.denominator); if (v4l2_detect_gtf(total_v_lines, h_freq, bt-vsync, - bt-polarities, false, + bt-polarities, bt-interlaced, aspect_ratio, timings)) return true; } -- 1.9.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
[RFC PATCH 3/4] adv7604: Use interlaced info for cvt/gtf timing detection
The interlaced information from stdi is passed to detect_cvt/gtf(). These functions now supports timing calculations for interlaced format. Cc: Hans Verkuil hans.verk...@cisco.com Cc: Martin Bugge marbu...@cisco.com Cc: Mats Randgaard matra...@cisco.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com Signed-off-by: Prashant Laddha prlad...@cisco.com --- drivers/media/i2c/adv7604.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 74abfd4..cf9383b 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1304,12 +1304,12 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, if (v4l2_detect_cvt(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, timings)) + stdi-interlaced, timings)) return 0; if (v4l2_detect_gtf(stdi-lcf + 1, hfreq, stdi-lcvs, (stdi-hs_pol == '+' ? V4L2_DV_HSYNC_POS_POL : 0) | (stdi-vs_pol == '+' ? V4L2_DV_VSYNC_POS_POL : 0), - false, state-aspect_ratio, timings)) + stdi-interlaced, state-aspect_ratio, timings)) return 0; v4l2_dbg(2, debug, sd, -- 1.9.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: [RFC] Extend struct v4l2_fmtdesc to give more format info
On 03/22/2015 08:56 AM, Sakari Ailus wrote: Hi Hans, On Fri, Mar 20, 2015 at 02:25:57PM +0100, Hans Verkuil wrote: This is a proposal to extend the information returned by v4l2_fmtdesc (VIDIOC_ENUM_FMT). Especially in combination with my previous RFC PATCH (https://patchwork.linuxtv.org/patch/28877/) this is very easy to fill in correctly in the core, and it will help both drivers and applications. It is very common that you need to know whether the format is for rgb, greyscale or YUV, whether a format is only supported with the multiplanar API or not (useful for the libv4l-mplane plugin to avoid enumerating multiplanar formats), whether there is an alpha channel, what the chroma subsampling format is and how planar formats are organized. struct v4l2_fmtdesc { __u32 index; /* Format number */ __u32 type; /* enum v4l2_buf_type */ __u32 flags; __u8description[32];/* Description string */ __u32 pixelformat;/* Format fourcc */ __u8color_encoding; /* Color encoding */ __u8chroma_subsampling; /* Chroma subsampling */ __u8planar; /* Planar format organization */ __u8reserved2; __u32 reserved[3]; }; #define V4L2_FMT_FLAG_COMPRESSED 0x0001 #define V4L2_FMT_FLAG_EMULATED 0x0002 #define V4L2_FMT_FLAG_IS_MPLANE 0x0004 #define V4L2_FMT_FLAG_HAS_ALPHA 0x0008 #define V4L2_FMT_COLOR_ENC_UNKNOWN 0 #define V4L2_FMT_COLOR_ENC_RGB 1 #define V4L2_FMT_COLOR_ENC_GREY 2 #define V4L2_FMT_COLOR_ENC_YCBCR3 #define V4L2_FMT_CHROMA_UNKNOWN 0 #define V4L2_FMT_CHROMA_4_4_4 1 #define V4L2_FMT_CHROMA_4_2_2 2 #define V4L2_FMT_CHROMA_4_2_0 3 #define V4L2_FMT_CHROMA_4_1_1 4 #define V4L2_FMT_CHROMA_4_1_0 5 #define V4L2_FMT_PLANAR_UNKNOWN 0 #define V4L2_FMT_PLANAR_NONE 1 /* not a planar format */ #define V4L2_FMT_PLANAR_Y_CBCR 2/* one luma, one packed chroma plane */ #define V4L2_FMT_PLANAR_Y_CB_CR 3/* one luma and two chroma planes */ For compressed formats color_encoding, chroma_subsampling and planar are all set to 0. Using this information helps both drivers and applications to calculate the bytesperline values and offsets of each plane for formats like PIX_FMT_YUV420. I've worked with this in vivid and in qv4l2, and it is a real pain without this information. Every driver and app needs to do the same calculations. It's trivial to add support for this in the v4l2 core. How much of this is defined by the 4cc code already? Everything? Yes, everything. This is an interesting case. The information would likely be needed by both applications and drivers but in the kernel API itself it's redundant, isn't it? Not really. Most drivers (at least those that have some of the more complex formats) encode this information in their own tables (usually in some sort of a bit-depth field and whether a format is rgb or yuv). By moving this info to the core you can simplify drivers by just asking the core for that info. It also makes it possible to add helper functions to calculate things like the sizeimage value, which is non-trivial in the case of the planar formats. I am also considering adding a bits_per_pixel field. It is likely useful as an internal kernel helper function, but whether it helps applications is something I don't really know. I think this would be nice to have. But like the others, I wonder if the kernel API is the right place for this. Do you have concrete examples (excluding the vivi driver) where drivers would benefit from this in other than a trivial manner? I can imagine the user space would though. Take a look at drivers/media/platform/coda/coda-common.c for example (just the first that popped up in my search, I know there are others). A function like coda_try_fmt can certainly be simplified. Basically all this is meta information about a fourcc. Every driver and application that uses such a fourcc has to duplicate that information today, which is a waste. If we fill in the fmtdesc in the core anyway, then why not add this info? It's trivial. Regards, Hans -- 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: [RFC] Extend struct v4l2_fmtdesc to give more format info
Hi Hans, On Fri, Mar 20, 2015 at 02:25:57PM +0100, Hans Verkuil wrote: This is a proposal to extend the information returned by v4l2_fmtdesc (VIDIOC_ENUM_FMT). Especially in combination with my previous RFC PATCH (https://patchwork.linuxtv.org/patch/28877/) this is very easy to fill in correctly in the core, and it will help both drivers and applications. It is very common that you need to know whether the format is for rgb, greyscale or YUV, whether a format is only supported with the multiplanar API or not (useful for the libv4l-mplane plugin to avoid enumerating multiplanar formats), whether there is an alpha channel, what the chroma subsampling format is and how planar formats are organized. struct v4l2_fmtdesc { __u32 index; /* Format number */ __u32 type; /* enum v4l2_buf_type */ __u32 flags; __u8description[32];/* Description string */ __u32 pixelformat;/* Format fourcc */ __u8color_encoding; /* Color encoding */ __u8chroma_subsampling; /* Chroma subsampling */ __u8planar; /* Planar format organization */ __u8reserved2; __u32 reserved[3]; }; #define V4L2_FMT_FLAG_COMPRESSED 0x0001 #define V4L2_FMT_FLAG_EMULATED 0x0002 #define V4L2_FMT_FLAG_IS_MPLANE 0x0004 #define V4L2_FMT_FLAG_HAS_ALPHA 0x0008 #define V4L2_FMT_COLOR_ENC_UNKNOWN 0 #define V4L2_FMT_COLOR_ENC_RGB 1 #define V4L2_FMT_COLOR_ENC_GREY 2 #define V4L2_FMT_COLOR_ENC_YCBCR3 #define V4L2_FMT_CHROMA_UNKNOWN 0 #define V4L2_FMT_CHROMA_4_4_4 1 #define V4L2_FMT_CHROMA_4_2_2 2 #define V4L2_FMT_CHROMA_4_2_0 3 #define V4L2_FMT_CHROMA_4_1_1 4 #define V4L2_FMT_CHROMA_4_1_0 5 #define V4L2_FMT_PLANAR_UNKNOWN 0 #define V4L2_FMT_PLANAR_NONE 1 /* not a planar format */ #define V4L2_FMT_PLANAR_Y_CBCR 2 /* one luma, one packed chroma plane */ #define V4L2_FMT_PLANAR_Y_CB_CR 3 /* one luma and two chroma planes */ For compressed formats color_encoding, chroma_subsampling and planar are all set to 0. Using this information helps both drivers and applications to calculate the bytesperline values and offsets of each plane for formats like PIX_FMT_YUV420. I've worked with this in vivid and in qv4l2, and it is a real pain without this information. Every driver and app needs to do the same calculations. It's trivial to add support for this in the v4l2 core. How much of this is defined by the 4cc code already? Everything? This is an interesting case. The information would likely be needed by both applications and drivers but in the kernel API itself it's redundant, isn't it? I am also considering adding a bits_per_pixel field. It is likely useful as an internal kernel helper function, but whether it helps applications is something I don't really know. I think this would be nice to have. But like the others, I wonder if the kernel API is the right place for this. Do you have concrete examples (excluding the vivi driver) where drivers would benefit from this in other than a trivial manner? I can imagine the user space would though. Just my 5 euro cents. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk -- 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 07/22] si2168: change firmware version print from debug to info
Even firmware version is not needed to know, it is still interesting and useful to know some cases. Due to that increase its printing to info log level. Signed-off-by: Antti Palosaari cr...@iki.fi --- drivers/media/dvb-frontends/si2168.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index a9486ef..e51676c 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -504,7 +504,7 @@ static int si2168_init(struct dvb_frontend *fe) if (ret) goto err; - dev_dbg(client-dev, firmware version: %c.%c.%d\n, + dev_info(client-dev, firmware version: %c.%c.%d\n, cmd.args[6], cmd.args[7], cmd.args[8]); /* set ts mode */ -- http://palosaari.fi/ -- 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] s5p-mfc: correct the formats info for encoder
Hi Ayaka, Could you resend this patch with your sign-off? Best wishes, -- Kamil Debski Samsung RD Institute Poland -Original Message- From: ayaka [mailto:ay...@soulik.info] Sent: Wednesday, July 23, 2014 6:15 PM To: linux-media@vger.kernel.org Cc: kyungmin.p...@samsung.com; k.deb...@samsung.com; jtp.p...@samsung.com; m.che...@samsung.com; ayaka Subject: [PATCH] s5p-mfc: correct the formats info for encoder The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index d26b248..4ea3796 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -32,7 +32,7 @@ #include s5p_mfc_intr.h #include s5p_mfc_opr.h -#define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12MT +#define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENC V4L2_PIX_FMT_H264 static struct s5p_mfc_fmt formats[] = { @@ -67,8 +67,7 @@ static struct s5p_mfc_fmt formats[] = { .codec_mode = S5P_MFC_CODEC_NONE, .type = MFC_FMT_RAW, .num_planes = 2, - .versions = MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | - MFC_V8_BIT, + .versions = MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT, }, { .name = H264 Encoded Stream, -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
I am very sorry to forget the Sign-off again and thank you for reviewing. ayaka (1): s5p-mfc: correct the formats info for encoder drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. Signed-off-by: ayaka ay...@soulik.info --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index d26b248..4ea3796 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -32,7 +32,7 @@ #include s5p_mfc_intr.h #include s5p_mfc_opr.h -#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12MT +#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENCV4L2_PIX_FMT_H264 static struct s5p_mfc_fmt formats[] = { @@ -67,8 +67,7 @@ static struct s5p_mfc_fmt formats[] = { .codec_mode = S5P_MFC_CODEC_NONE, .type = MFC_FMT_RAW, .num_planes = 2, - .versions = MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | - MFC_V8_BIT, + .versions = MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT, }, { .name = H264 Encoded Stream, -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
I am very sorry to forget the Sign-off again and thank you for reviewing. ayaka (1): s5p-mfc: correct the formats info for encoder drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. Signed-off-by: ayaka ay...@soulik.info --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index d26b248..4ea3796 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -32,7 +32,7 @@ #include s5p_mfc_intr.h #include s5p_mfc_opr.h -#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12MT +#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENCV4L2_PIX_FMT_H264 static struct s5p_mfc_fmt formats[] = { @@ -67,8 +67,7 @@ static struct s5p_mfc_fmt formats[] = { .codec_mode = S5P_MFC_CODEC_NONE, .type = MFC_FMT_RAW, .num_planes = 2, - .versions = MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | - MFC_V8_BIT, + .versions = MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT, }, { .name = H264 Encoded Stream, -- 1.9.3 -- 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
DVB new get info ioctl
Hi Michael, As you know, one of the topics discussed during the last Media Summit were about writing a new ioctl to replace FE_GET_INFO's fe_caps. The summary of our discussions follow bellow: (mental note: I should put the description below on our mini-summit notes): SUMMIT The main issue with fe_caps is that, currently, there are only two bits left, between: FE_HAS_EXTENDED_CAPS= 0x80, and FE_CAN_MULTISTREAM = 0x400, And this is not enough to represent the current capabilities of modern delivery system's frontends. As a few examples of missing things that we want to be able to report, we have: - Some DVB-C2 demods supports automatic symbol rate detection between a certain range (Ralph); - Some devices that only work on auto mode, sometimes being even unable to return what it was detected, even with the full specs (Ralph). - Complex delivery systems like ISDB-T have some combinations that aren't very common, and some chipset providers decided to not implement (Mauro). For example, mb86a20s frontend doesn't support guard interval equal to 1/32[1]. So, the agreeded strategy is to write a new ioctl that, once the delivery system is set, it will return what are the valid values/ranges that a given frontend property can support. In order to optimize the drivers, the core could pre-fill it with all that it is supported by a given delivery system, letting the driver to override it, disabling the features that aren't supported. Michael proposed to send RFCs for that. /SUMMIT [1] Also, while double checking today at the code, it also doesn't support mode 1 (2K). That's what it was agreed during the meeting. After our discussions about a new ioctl that would be able to properly report the frontend capabilities for new standards, during the Media Summit, in order to be able to report the currently needs, I did some brainstorming about that. It come to me that the fe_caps replacement ioctl should need to return not only the valid values/ranges but also a flag that will indicate if: - The frontend supports auto-detecting the parameter (CAN_AUTO); - The frontend allows setting such parameter (CAN_SET) [2]; - The frontend can report the detected parameter (CAN_GET); - If the valid values comes on ranges (IS_RANGE), to be used by parameters like frequency and symbol rate. Btw, we have a problem with IS_RANGE for symbol rate: There are actually two ranges there: - The supported symbol rate range; - The auto-detected symbol rate range. Perhaps Ralph could shed us a light on it, but my understanding is that some devices might have a broader supported range than the one that the frontend can auto-detect. If so, the solution could be to add an extra property for the autodetection symbol rate range. [2] ISDB-S new Toshiba demod, for example, doesn't allow setting the modulation. This should always be auto-detected via TMCC table. Btw, this seems to be a requirement at the spec (but nothing prevents some vendor to not implement it). We've discussed in priv that we might report everything as ranges, but, on a second taught, I think that we should only use ranges for numeric values, and not for enums. 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
RE: [PATCH] s5p-mfc: correct the formats info for encoder
Hi Ayaka, Sorry for such a late reply - I just noticed this patch. From: ayaka [mailto:ay...@soulik.info] Sent: Wednesday, July 23, 2014 6:15 PM To: linux-media@vger.kernel.org Cc: kyungmin.p...@samsung.com; k.deb...@samsung.com; jtp.p...@samsung.com; m.che...@samsung.com; ayaka Subject: [PATCH] s5p-mfc: correct the formats info for encoder The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. A proper Sign-off is missing here. According to the documentation of MFC v5 I have non-tiled format is supported. Which documentation were you looking at? From my documentation: ++ ENC_MAP_FOR_CUR 0xC51C Memory structure setting register of the current frame. R/W 0x BitsNameDescription Reset Value [31:2] RESERVEDReserved0 [1:0] ENC_MAP_FOR_CUR Memory structure of the current frame 0 : Linear mode 3 : 64x32 tiled mode0 ++ Best wishes, -- Kamil Debski Samsung RD Institute Poland --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index d26b248..4ea3796 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -32,7 +32,7 @@ #include s5p_mfc_intr.h #include s5p_mfc_opr.h -#define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12MT +#define DEF_SRC_FMT_ENC V4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENC V4L2_PIX_FMT_H264 static struct s5p_mfc_fmt formats[] = { @@ -67,8 +67,7 @@ static struct s5p_mfc_fmt formats[] = { .codec_mode = S5P_MFC_CODEC_NONE, .type = MFC_FMT_RAW, .num_planes = 2, - .versions = MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | - MFC_V8_BIT, + .versions = MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT, }, { .name = H264 Encoded Stream, -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 2014/09/23 00:28, Kamil Debski wrote: Hi Ayaka, Sorry for such a late reply - I just noticed this patch. The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. A proper Sign-off is missing here. Sorry to miss it again. According to the documentation of MFC v5 I have non-tiled format is supported. Which documentation were you looking at? But the V4L2_PIX_FMT_NV12MT is only supported by MFC_V5_BIT from your code, V4L2_PIX_FMT_NV12M is supported by all the version. From my documentation: ++ ENC_MAP_FOR_CUR0xC51C Memory structure setting register of the current frame.R/W 0x Bits NameDescription Reset Value [31:2] RESERVED Reserved0 [1:0] ENC_MAP_FOR_CUR Memory structure of the current frame 0 : Linear mode 3 : 64x32 tiled mode 0 ++ In the page 2277. The same result. I think the V4L2_PIX_FMT_NV12MT is 64x32 Tiles mode, but what I remove for MFC v5 is V4L2_PIX_FMT_NV21M. Best wishes, - -- ayaka -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJUIFNLAAoJEPsGh4kgR4i5HcIP/2qwn7uIFq66qpSajXmtcLx3 3/wt8n26u6GhTMUnIJKZS07FGtv7qizUVqeY3WmfWQw3jLaUjZeVviVH08y3DrE8 +7Vjq2rxz57ou4bBtc4qIgTWB7z2yuVSpBOYUB94laItQ7KDap4EgLf89m4KaKTt 5nULR0byxXh+RuUOw80v0eP/TBz7SRfYZnulASV9QlGS6T3Xp6v4U6W8LbSbieR5 63PwPxYP7aDVb5R6qzaLIVXNuI53vn5VhrQ6JJUfKee5YSbkV/Ff6XK+7/P162Pn 5cVt06X+RUeZXHGqCroMNb9cdm+7JHOZL458NPn4NmTJnFcPNu6JzW9iLymHeHC8 iFmNhpDuHJBulKsW44lqKe1fHT22a5C/oJAI1ZS9c3yrH+TqHkfEkUJjglSRByzj ptTFFZVTCdiL5VwnDlfowR4ZzrkZuoWzHIn5cGeHogvbLbxCbtV67+IFpWlXfyJu rKnCI+DKYb5cjEiHm7kzGbAO04AfNMT79sNwrD+sPuvnaFyRiy2rjKv3ubnPFRVp 3agNRzAcCgmsW3K10P3ism4ceJUqeZtFvieCQrjiQdxj8EB7QAcgOhgn3K//zrQ1 mQP7xuVQcwpaRIOx/3jSlVWYFrkFs2+tmgS9oEn+v40gXOQXk8rML21gHvpDuCnf qJXx0UVYQRV7Bhgv8EFW =SNTL -END PGP SIGNATURE- -- 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]: sn9c20x: centralize repeated error/info messages with macros
Create inline functions to print info/error messages: sensor detected and sensor initialization failed which are used identically in many places. This makes it easier to change the message formats en masse and frees up some memory by centralizing repeated strings. Signed-off-by: Morgan Phillips winter2...@gmail.com --- drivers/media/usb/gspca/sn9c20x.c | 60 ++- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c index 41a9a89..558911e 100644 --- a/drivers/media/usb/gspca/sn9c20x.c +++ b/drivers/media/usb/gspca/sn9c20x.c @@ -65,6 +65,14 @@ MODULE_LICENSE(GPL); #define LED_REVERSE0x2 /* some cameras unset gpio to turn on leds */ #define FLIP_DETECT0x4 +/* info messages */ +#define pr_sensor_detected_info(sensor_name)\ +pr_info(%s sensor detected\n, sensor_name) + +/* error messages */ +#define pr_sensor_init_err(sensor_name)\ +pr_err(%s sensor initialization failed\n, sensor_name) + /* specific webcam descriptor */ struct sd { struct gspca_dev gspca_dev; @@ -1098,7 +1106,7 @@ static void ov9650_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov9650_init, ARRAY_SIZE(ov9650_init)); if (gspca_dev-usb_err 0) - pr_err(OV9650 sensor initialization failed\n); + pr_sensor_init_err(OV9650); sd-hstart = 1; sd-vstart = 7; } @@ -,7 +1119,7 @@ static void ov9655_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov9655_init, ARRAY_SIZE(ov9655_init)); if (gspca_dev-usb_err 0) - pr_err(OV9655 sensor initialization failed\n); + pr_sensor_init_err(OV9655); sd-hstart = 1; sd-vstart = 2; @@ -1125,7 +1133,7 @@ static void soi968_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, soi968_init, ARRAY_SIZE(soi968_init)); if (gspca_dev-usb_err 0) - pr_err(SOI968 sensor initialization failed\n); + pr_sensor_init_err(SOI968); sd-hstart = 60; sd-vstart = 11; @@ -1139,7 +1147,7 @@ static void ov7660_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov7660_init, ARRAY_SIZE(ov7660_init)); if (gspca_dev-usb_err 0) - pr_err(OV7660 sensor initialization failed\n); + pr_sensor_init_err(OV7660); sd-hstart = 3; sd-vstart = 3; } @@ -1152,7 +1160,7 @@ static void ov7670_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov7670_init, ARRAY_SIZE(ov7670_init)); if (gspca_dev-usb_err 0) - pr_err(OV7670 sensor initialization failed\n); + pr_sensor_init_err(OV7670); sd-hstart = 0; sd-vstart = 1; @@ -1169,13 +1177,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x8243) { i2c_w2_buf(gspca_dev, mt9v011_init, ARRAY_SIZE(mt9v011_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V011 sensor initialization failed\n); + pr_sensor_init_err(MT9V011); return; } sd-hstart = 2; sd-vstart = 2; sd-sensor = SENSOR_MT9V011; - pr_info(MT9V011 sensor detected\n); + pr_sensor_detected_info(MT9V011); return; } @@ -1187,13 +1195,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x823a) { i2c_w2_buf(gspca_dev, mt9v111_init, ARRAY_SIZE(mt9v111_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V111 sensor initialization failed\n); + pr_sensor_init_err(MT9V111); return; } sd-hstart = 2; sd-vstart = 2; sd-sensor = SENSOR_MT9V111; - pr_info(MT9V111 sensor detected\n); + pr_sensor_detected_info(MT9V111); return; } @@ -1210,13 +1218,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x1229) { i2c_w2_buf(gspca_dev, mt9v112_init, ARRAY_SIZE(mt9v112_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V112 sensor initialization failed\n); + pr_sensor_init_err(MT9V112); return; } sd-hstart = 6; sd-vstart = 2; sd-sensor = SENSOR_MT9V112; - pr_info(MT9V112 sensor detected\n); + pr_sensor_detected_info(MT9V112); return; } @@ -1229,7 +1237,7 @@ static void mt9m112_init_sensor
[PATCH v2] [media]: sn9c20x: centralize repeated error/info messages with macros
Create inline functions to print info/error messages: sensor detected and sensor initialization failed which are used identically in many places. This makes it easier to change the message formats en masse and frees up some memory by centralizing repeated strings. Signed-off-by: Morgan Phillips winter2...@gmail.com --- Changes since v2: * Fixed checkpatch.pl errors introduced from tabs being converted to spaces. drivers/media/usb/gspca/sn9c20x.c | 60 ++- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c index 41a9a89..339f7b0 100644 --- a/drivers/media/usb/gspca/sn9c20x.c +++ b/drivers/media/usb/gspca/sn9c20x.c @@ -65,6 +65,14 @@ MODULE_LICENSE(GPL); #define LED_REVERSE0x2 /* some cameras unset gpio to turn on leds */ #define FLIP_DETECT0x4 +/* info messages */ +#define pr_sensor_detected_info(sensor_name)\ + pr_info(%s sensor detected\n, sensor_name) + +/* error messages */ +#define pr_sensor_init_err(sensor_name)\ + pr_err(%s sensor initialization failed\n, sensor_name) + /* specific webcam descriptor */ struct sd { struct gspca_dev gspca_dev; @@ -1098,7 +1106,7 @@ static void ov9650_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov9650_init, ARRAY_SIZE(ov9650_init)); if (gspca_dev-usb_err 0) - pr_err(OV9650 sensor initialization failed\n); + pr_sensor_init_err(OV9650); sd-hstart = 1; sd-vstart = 7; } @@ -,7 +1119,7 @@ static void ov9655_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov9655_init, ARRAY_SIZE(ov9655_init)); if (gspca_dev-usb_err 0) - pr_err(OV9655 sensor initialization failed\n); + pr_sensor_init_err(OV9655); sd-hstart = 1; sd-vstart = 2; @@ -1125,7 +1133,7 @@ static void soi968_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, soi968_init, ARRAY_SIZE(soi968_init)); if (gspca_dev-usb_err 0) - pr_err(SOI968 sensor initialization failed\n); + pr_sensor_init_err(SOI968); sd-hstart = 60; sd-vstart = 11; @@ -1139,7 +1147,7 @@ static void ov7660_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov7660_init, ARRAY_SIZE(ov7660_init)); if (gspca_dev-usb_err 0) - pr_err(OV7660 sensor initialization failed\n); + pr_sensor_init_err(OV7660); sd-hstart = 3; sd-vstart = 3; } @@ -1152,7 +1160,7 @@ static void ov7670_init_sensor(struct gspca_dev *gspca_dev) msleep(200); i2c_w1_buf(gspca_dev, ov7670_init, ARRAY_SIZE(ov7670_init)); if (gspca_dev-usb_err 0) - pr_err(OV7670 sensor initialization failed\n); + pr_sensor_init_err(OV7670); sd-hstart = 0; sd-vstart = 1; @@ -1169,13 +1177,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x8243) { i2c_w2_buf(gspca_dev, mt9v011_init, ARRAY_SIZE(mt9v011_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V011 sensor initialization failed\n); + pr_sensor_init_err(MT9V011); return; } sd-hstart = 2; sd-vstart = 2; sd-sensor = SENSOR_MT9V011; - pr_info(MT9V011 sensor detected\n); + pr_sensor_detected_info(MT9V011); return; } @@ -1187,13 +1195,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x823a) { i2c_w2_buf(gspca_dev, mt9v111_init, ARRAY_SIZE(mt9v111_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V111 sensor initialization failed\n); + pr_sensor_init_err(MT9V111); return; } sd-hstart = 2; sd-vstart = 2; sd-sensor = SENSOR_MT9V111; - pr_info(MT9V111 sensor detected\n); + pr_sensor_detected_info(MT9V111); return; } @@ -1210,13 +1218,13 @@ static void mt9v_init_sensor(struct gspca_dev *gspca_dev) value == 0x1229) { i2c_w2_buf(gspca_dev, mt9v112_init, ARRAY_SIZE(mt9v112_init)); if (gspca_dev-usb_err 0) { - pr_err(MT9V112 sensor initialization failed\n); + pr_sensor_init_err(MT9V112); return; } sd-hstart = 6; sd-vstart = 2; sd-sensor = SENSOR_MT9V112; - pr_info(MT9V112 sensor detected\n); + pr_sensor_detected_info(MT9V112
[PATCH] correct formats info in s5p-mfc encoder
I have tested it in exynos 4412. I enable MFC and with 64MB buffer in echo bank. ayaka (1): s5p-mfc: correct the formats info for encoder drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.3 -- 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] s5p-mfc: correct the formats info for encoder
The NV12M is supported by all the version of MFC, so it is better to use it as default OUTPUT format. MFC v5 doesn't support NV21, I have tested it, for the SEC doc it is not supported either. --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index d26b248..4ea3796 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -32,7 +32,7 @@ #include s5p_mfc_intr.h #include s5p_mfc_opr.h -#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12MT +#define DEF_SRC_FMT_ENCV4L2_PIX_FMT_NV12M #define DEF_DST_FMT_ENCV4L2_PIX_FMT_H264 static struct s5p_mfc_fmt formats[] = { @@ -67,8 +67,7 @@ static struct s5p_mfc_fmt formats[] = { .codec_mode = S5P_MFC_CODEC_NONE, .type = MFC_FMT_RAW, .num_planes = 2, - .versions = MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | - MFC_V8_BIT, + .versions = MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT, }, { .name = H264 Encoded Stream, -- 1.9.3 -- 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: [CODA] Info about internal buffers in CodaDX6
Hello, No one can give me more information about these registers ? Thank you. Bets regards, Gaëtan Carlier. On 06/03/2014 10:32 AM, Gaëtan Carlier wrote: Dear, I am back to add support of h.264 decoding using Coda DX6 on i.MX27 (after long months of inactivity). I base my work on driver from linux 2.6.22 (libvpu) and last coda.c from linux-next/master. When I send DEC_SEQ_INIT command, it fails but I don't know why. 1) Which internal buffers do Coda DX6 really have/used for decoding PARABUF, WORKBUF, PSBUF, ...) ? 2) What is their role ? 3) I see in some code that there is a command CODA_RET_DEC_SEQ_ERR_REASON (0x1E0), which has the same opcode has RET_DEC_SEQ_NEXT_FRAME_NUM, but when I run this command after DEC_SEQ_INIT, it returns 1 that does not seems to be correct error (regarding RetCode enum in vpu_lib.h in libvpu) Code is based on 3.6.0 kernel revision with some backport from more recent version of coda.c Thanks a lot for your help. Best regards, Gaëtan Carlier. -- 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 v4 29/49] adv7604: Don't put info string arrays on the stack
From: Lars-Peter Clausen l...@metafoo.de We do not want to modify the info string arrays ever, so no need to waste stack space for them. While we are at it also make them const. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Reviewed-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/i2c/adv7604.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 7358853..dd0a9a9 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1882,13 +1882,13 @@ static int adv7604_log_status(struct v4l2_subdev *sd) struct stdi_readback stdi; u8 reg_io_0x02 = io_read(sd, 0x02); - char *csc_coeff_sel_rb[16] = { + static const char * const csc_coeff_sel_rb[16] = { bypassed, YPbPr601 - RGB, reserved, YPbPr709 - RGB, reserved, RGB - YPbPr601, reserved, RGB - YPbPr709, reserved, YPbPr709 - YPbPr601, YPbPr601 - YPbPr709, reserved, reserved, reserved, reserved, manual }; - char *input_color_space_txt[16] = { + static const char * const input_color_space_txt[16] = { RGB limited range (16-235), RGB full range (0-255), YCbCr Bt.601 (16-235), YCbCr Bt.709 (16-235), xvYCC Bt.601, xvYCC Bt.709, @@ -1896,12 +1896,12 @@ static int adv7604_log_status(struct v4l2_subdev *sd) invalid, invalid, invalid, invalid, invalid, invalid, invalid, automatic }; - char *rgb_quantization_range_txt[] = { + static const char * const rgb_quantization_range_txt[] = { Automatic, RGB limited range (16-235), RGB full range (0-255), }; - char *deep_color_mode_txt[4] = { + static const char * const deep_color_mode_txt[4] = { 8-bits per channel, 10-bits per channel, 12-bits per channel, -- 1.8.3.2 -- 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
[yavta PATCH v3 09/11] Shorten dequeued buffer info print
Signed-off-by: Sakari Ailus sakari.ai...@iki.fi --- yavta.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yavta.c b/yavta.c index 5516675..e81e058 100644 --- a/yavta.c +++ b/yavta.c @@ -721,13 +721,13 @@ static void get_ts_flags(uint32_t flags, const char **ts_type, const char **ts_s { switch (flags V4L2_BUF_FLAG_TIMESTAMP_MASK) { case V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN: - *ts_type = unknown; + *ts_type = unk; break; case V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC: - *ts_type = monotonic; + *ts_type = mono; break; default: - *ts_type = invalid; + *ts_type = inv; } switch (flags V4L2_BUF_FLAG_TSTAMP_SRC_MASK) { case V4L2_BUF_FLAG_TSTAMP_SRC_EOF: @@ -737,7 +737,7 @@ static void get_ts_flags(uint32_t flags, const char **ts_type, const char **ts_s *ts_source = SoE; break; default: - *ts_source = invalid; + *ts_source = inv; } } @@ -1490,7 +1490,7 @@ static int video_do_capture(struct device *dev, unsigned int nframes, clock_gettime(CLOCK_MONOTONIC, ts); get_ts_flags(buf.flags, ts_type, ts_source); - printf(%u (%u) [%c] %u %u bytes %ld.%06ld %ld.%06ld %.3f fps ts %s/%s\n, i, buf.index, + printf(%u (%u) [%c] %u %u B %ld.%06ld %ld.%06ld %.3f fps ts %s/%s\n, i, buf.index, (buf.flags V4L2_BUF_FLAG_ERROR) ? 'E' : '-', buf.sequence, buf.bytesused, buf.timestamp.tv_sec, buf.timestamp.tv_usec, ts.tv_sec, ts.tv_nsec/1000, fps, -- 1.7.10.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
[PATCH 01/11] libdvbv5: support info info log via dvb_loginfo
dvb_loginfo log support without setting output color. Signed-off-by: André Roth neol...@gmail.com --- lib/include/dvb-log.h | 3 +++ lib/libdvbv5/dvb-log.c | 26 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/include/dvb-log.h b/lib/include/dvb-log.h index a72adce..755167a 100644 --- a/lib/include/dvb-log.h +++ b/lib/include/dvb-log.h @@ -38,6 +38,9 @@ typedef void (*dvb_logfunc)(int level, const char *fmt, ...) __attribute__ (( fo #define dvb_logwarn(fmt, arg...) do {\ parms-logfunc(LOG_WARNING, fmt, ##arg); \ } while (0) +#define dvb_loginfo(fmt, arg...) do {\ + parms-logfunc(LOG_NOTICE, fmt, ##arg); \ +} while (0) #define dvb_perror(msg) do {\ diff --git a/lib/libdvbv5/dvb-log.c b/lib/libdvbv5/dvb-log.c index 87d92f2..8bb34ca 100644 --- a/lib/libdvbv5/dvb-log.c +++ b/lib/libdvbv5/dvb-log.c @@ -30,15 +30,15 @@ static const struct loglevel { const char *color; int fd; } loglevels[9] = { - {EMERG , \033[31m, STDERR_FILENO }, - {ALERT , \033[31m, STDERR_FILENO }, - {CRITICAL, \033[31m, STDERR_FILENO }, - {ERROR , \033[31m, STDERR_FILENO }, - {WARNING , \033[33m, STDOUT_FILENO }, - {NOTICE , \033[36m, STDOUT_FILENO }, - {INFO, \033[36m, STDOUT_FILENO }, - {DEBUG , \033[32m, STDOUT_FILENO }, - {, \033[0m, STDOUT_FILENO }, + {EMERG, \033[31m, STDERR_FILENO }, + {ALERT, \033[31m, STDERR_FILENO }, + {CRITICAL , \033[31m, STDERR_FILENO }, + {ERROR, \033[31m, STDERR_FILENO }, + {WARNING , \033[33m, STDOUT_FILENO }, + {, \033[36m, STDOUT_FILENO }, /* NOTICE */ + {, NULL, STDOUT_FILENO }, /* INFO */ + {DEBUG, \033[32m, STDOUT_FILENO }, + {, \033[0m, STDOUT_FILENO }, /* reset*/ }; #define LOG_COLOROFF 8 @@ -49,14 +49,14 @@ void dvb_default_log(int level, const char *fmt, ...) va_list ap; va_start(ap, fmt); FILE *out = stdout; - if(STDERR_FILENO == loglevels[level].fd) + if (STDERR_FILENO == loglevels[level].fd) out = stderr; - if(isatty(loglevels[level].fd)) + if (loglevels[level].color isatty(loglevels[level].fd)) fputs(loglevels[level].color, out); - fprintf(out, %s , loglevels[level].name); + fprintf(out, %s, loglevels[level].name); vfprintf(out, fmt, ap); fprintf(out, \n); - if(isatty(loglevels[level].fd)) + if(loglevels[level].color isatty(loglevels[level].fd)) fputs(loglevels[LOG_COLOROFF].color, out); va_end(ap); } -- 1.8.3.2 -- 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 v2 30/48] adv7604: Don't put info string arrays on the stack
From: Lars-Peter Clausen l...@metafoo.de We do not want to modify the info string arrays ever, so no need to waste stack space for them. While we are at it also make them const. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/i2c/adv7604.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index c3a76ac..81d737c 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1882,13 +1882,13 @@ static int adv7604_log_status(struct v4l2_subdev *sd) struct stdi_readback stdi; u8 reg_io_0x02 = io_read(sd, 0x02); - char *csc_coeff_sel_rb[16] = { + static const char * const csc_coeff_sel_rb[16] = { bypassed, YPbPr601 - RGB, reserved, YPbPr709 - RGB, reserved, RGB - YPbPr601, reserved, RGB - YPbPr709, reserved, YPbPr709 - YPbPr601, YPbPr601 - YPbPr709, reserved, reserved, reserved, reserved, manual }; - char *input_color_space_txt[16] = { + static const char * const input_color_space_txt[16] = { RGB limited range (16-235), RGB full range (0-255), YCbCr Bt.601 (16-235), YCbCr Bt.709 (16-235), xvYCC Bt.601, xvYCC Bt.709, @@ -1896,12 +1896,12 @@ static int adv7604_log_status(struct v4l2_subdev *sd) invalid, invalid, invalid, invalid, invalid, invalid, invalid, automatic }; - char *rgb_quantization_range_txt[] = { + static const char * const rgb_quantization_range_txt[] = { Automatic, RGB limited range (16-235), RGB full range (0-255), }; - char *deep_color_mode_txt[4] = { + static const char * const deep_color_mode_txt[4] = { 8-bits per channel, 10-bits per channel, 12-bits per channel, -- 1.8.3.2 -- 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
[REVIEW PATCH 13/13] DocBook: media: add some general info about RF tuners
Add some info what is RF tuner in context of V4L RF tuner class. Cc: Hans Verkuil hverk...@xs4all.nl Signed-off-by: Antti Palosaari cr...@iki.fi --- Documentation/DocBook/media/v4l/controls.xml | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 92e3335..9adf630 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -4975,8 +4975,27 @@ defines possible values for de-emphasis. Here they are:/entry section id=rf-tuner-controls titleRF Tuner Control Reference/title - paraThe RF Tuner (RF_TUNER) class includes controls for common features -of devices having RF tuner./para + para +The RF Tuner (RF_TUNER) class includes controls for common features of devices +having RF tuner. + /para + para +In this context, RF tuner is radio receiver circuit between antenna and +demodulator. It receives radio frequency (RF) from the antenna and converts that +received signal to lower intermediate frequency (IF) or baseband frequency (BB). +Tuners that could do baseband output are often called Zero-IF tuners. Older +tuners were typically simple PLL tuners inside a metal box, whilst newer ones +are highly integrated chips without a metal box silicon tuners. These controls +are mostly applicable for new feature rich silicon tuners, just because older +tuners does not have much adjustable features. + /para + para +For more information about RF tuners see +ulink url=http://en.wikipedia.org/wiki/Tuner_%28radio%29;Tuner (radio)/ulink +and +ulink url=http://en.wikipedia.org/wiki/RF_front_end;RF front end/ulink +from Wikipedia. + /para table pgwide=1 frame=none id=rf-tuner-control-id titleRF_TUNER Control IDs/title -- 1.8.5.3 -- 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 30/47] adv7604: Don't put info string arrays on the stack
From: Lars-Peter Clausen l...@metafoo.de We do not want to modify the info string arrays ever, so no need to waste stack space for them. While we are at it also make them const. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/i2c/adv7604.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 98ac383..cfcbb6d 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1886,13 +1886,13 @@ static int adv7604_log_status(struct v4l2_subdev *sd) struct stdi_readback stdi; u8 reg_io_0x02 = io_read(sd, 0x02); - char *csc_coeff_sel_rb[16] = { + static const char * const csc_coeff_sel_rb[16] = { bypassed, YPbPr601 - RGB, reserved, YPbPr709 - RGB, reserved, RGB - YPbPr601, reserved, RGB - YPbPr709, reserved, YPbPr709 - YPbPr601, YPbPr601 - YPbPr709, reserved, reserved, reserved, reserved, manual }; - char *input_color_space_txt[16] = { + static const char * const input_color_space_txt[16] = { RGB limited range (16-235), RGB full range (0-255), YCbCr Bt.601 (16-235), YCbCr Bt.709 (16-235), xvYCC Bt.601, xvYCC Bt.709, @@ -1900,12 +1900,12 @@ static int adv7604_log_status(struct v4l2_subdev *sd) invalid, invalid, invalid, invalid, invalid, invalid, invalid, automatic }; - char *rgb_quantization_range_txt[] = { + static const char * const rgb_quantization_range_txt[] = { Automatic, RGB limited range (16-235), RGB full range (0-255), }; - char *deep_color_mode_txt[4] = { + static const char * const deep_color_mode_txt[4] = { 8-bits per channel, 10-bits per channel, 12-bits per channel, -- 1.8.3.2 -- 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 3/4] [media] adv7842: log-status for Audio Video Info frames (AVI)
Clear any pending AVI checksum-errors. To be able to display last received AVI. Cc: Mats Randgaard matra...@cisco.com Cc: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Martin Bugge marbu...@cisco.com --- drivers/media/i2c/adv7842.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 3aa1a7c..209b175 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -2191,7 +2191,8 @@ static void print_avi_infoframe(struct v4l2_subdev *sd) { int i; uint8_t buf[14]; - uint8_t avi_inf_len; + u8 avi_len; + u8 avi_ver; struct avi_info_frame avi; if (!(hdmi_read(sd, 0x05) 0x80)) { @@ -2204,18 +2205,20 @@ static void print_avi_infoframe(struct v4l2_subdev *sd) } if (io_read(sd, 0x88) 0x10) { - /* Note: the ADV7842 calculated incorrect checksums for InfoFrames - with a length of 14 or 15. See the ADV7842 Register Settings - Recommendations document for more details. */ - v4l2_info(sd, AVI infoframe checksum error\n); - return; + v4l2_info(sd, AVI infoframe checksum error has occurred earlier\n); + io_write(sd, 0x8a, 0x10); /* clear AVI_INF_CKS_ERR_RAW */ + if (io_read(sd, 0x88) 0x10) { + v4l2_info(sd, AVI infoframe checksum error still present\n); + io_write(sd, 0x8a, 0x10); /* clear AVI_INF_CKS_ERR_RAW */ + } } - avi_inf_len = infoframe_read(sd, 0xe2); + avi_len = infoframe_read(sd, 0xe2); + avi_ver = infoframe_read(sd, 0xe1); v4l2_info(sd, AVI infoframe version %d (%d byte)\n, - infoframe_read(sd, 0xe1), avi_inf_len); + avi_ver, avi_len); - if (infoframe_read(sd, 0xe1) != 0x02) + if (avi_ver != 0x02) return; for (i = 0; i 14; i++) -- 1.8.1.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
[PATCH] em28xx: fix I2S audio sample rate definitions and info output
The audio configuration in chip config register 0x00 and eeprom are always consistent. But currently the audio configuration #defines for the chip config register say 0x20 means 3 sample rates and 0x30 5 sample rates, while the eeprom info output says 0x20 means 1 sample rate and 0x30 3 sample rates. I've checked the datasheet excerpts I have and it seems that the meaning of these bits is different for em2820/40 (1 and 3 sample rates) and em2860+ (3 and 5 smaple rates). I have also checked my Hauppauge WinTV USB 2 (em2840) and the chip/eeprom audio config 0x20 matches the sample rates reproted by the USB device descriptor (32k only). Signed-off-by: Frank Schäfer fschaefer@googlemail.com --- drivers/media/usb/em28xx/em28xx-core.c | 24 +--- drivers/media/usb/em28xx/em28xx-i2c.c | 10 -- drivers/media/usb/em28xx/em28xx-reg.h | 10 ++ drivers/media/usb/em28xx/em28xx.h |3 +-- 4 Dateien geändert, 28 Zeilen hinzugefügt(+), 19 Zeilen entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index f6076a5..192b657 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -525,17 +525,19 @@ int em28xx_audio_setup(struct em28xx *dev) dev-has_alsa_audio = false; dev-audio_mode.has_audio = false; return 0; - } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_3_SAMPRATES) { - em28xx_info(I2S Audio (3 sample rates)\n); - dev-audio_mode.i2s_3rates = 1; - } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_5_SAMPRATES) { - em28xx_info(I2S Audio (5 sample rates)\n); - dev-audio_mode.i2s_5rates = 1; - } - - if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { + } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { + if (dev-chip_id CHIP_ID_EM2860 + (cfg EM28XX_CHIPCFG_AUDIOMASK) == + EM2820_CHIPCFG_I2S_1_SAMPRATE) + dev-audio_mode.i2s_samplerates = 1; + else if (dev-chip_id = CHIP_ID_EM2860 +(cfg EM28XX_CHIPCFG_AUDIOMASK) == +EM2860_CHIPCFG_I2S_5_SAMPRATES) + dev-audio_mode.i2s_samplerates = 5; + else + dev-audio_mode.i2s_samplerates = 3; + em28xx_info(I2S Audio (%d sample rate(s))\n, + dev-audio_mode.i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev-audio_mode.ac97 = EM28XX_NO_AC97; goto init_audio; diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index c4ff973..f2d5f8a 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -736,10 +736,16 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, em28xx_info(\tAC97 audio (5 sample rates)\n); break; case 2: - em28xx_info(\tI2S audio, sample rate=32k\n); + if (dev-chip_id CHIP_ID_EM2860) + em28xx_info(\tI2S audio, sample rate=32k\n); + else + em28xx_info(\tI2S audio, 3 sample rates\n); break; case 3: - em28xx_info(\tI2S audio, 3 sample rates\n); + if (dev-chip_id CHIP_ID_EM2860) + em28xx_info(\tI2S audio, 3 sample rates\n); + else + em28xx_info(\tI2S audio, 5 sample rates\n); break; } diff --git a/drivers/media/usb/em28xx/em28xx-reg.h b/drivers/media/usb/em28xx/em28xx-reg.h index b769ceb..311fb34 100644 --- a/drivers/media/usb/em28xx/em28xx-reg.h +++ b/drivers/media/usb/em28xx/em28xx-reg.h @@ -25,10 +25,12 @@ #define EM28XX_R00_CHIPCFG 0x00 /* em28xx Chip Configuration 0x00 */ -#define EM28XX_CHIPCFG_VENDOR_AUDIO0x80 -#define EM28XX_CHIPCFG_I2S_VOLUME_CAPABLE 0x40 -#define EM28XX_CHIPCFG_I2S_5_SAMPRATES 0x30 -#define EM28XX_CHIPCFG_I2S_3_SAMPRATES 0x20 +#define EM2860_CHIPCFG_VENDOR_AUDIO0x80 +#define EM2860_CHIPCFG_I2S_VOLUME_CAPABLE 0x40 +#define EM2820_CHIPCFG_I2S_3_SAMPRATES 0x30 +#define EM2860_CHIPCFG_I2S_5_SAMPRATES 0x30 +#define EM2820_CHIPCFG_I2S_1_SAMPRATE 0x20 +#define EM2860_CHIPCFG_I2S_3_SAMPRATES 0x20 #define EM28XX_CHIPCFG_AC970x10 #define EM28XX_CHIPCFG_AUDIOMASK 0x30 diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 191ef35..4d8c7d2 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -292,8 +292,7 @@ struct
Re: [PATCH] em28xx: fix I2S audio sample rate definitions and info output
Em Sun, 22 Dec 2013 15:17:46 +0100 Frank Schäfer fschaefer@googlemail.com escreveu: The audio configuration in chip config register 0x00 and eeprom are always consistent. But currently the audio configuration #defines for the chip config register say 0x20 means 3 sample rates and 0x30 5 sample rates, while the eeprom info output says 0x20 means 1 sample rate and 0x30 3 sample rates. I've checked the datasheet excerpts I have and it seems that the meaning of these bits is different for em2820/40 (1 and 3 sample rates) and em2860+ (3 and 5 smaple rates). I have also checked my Hauppauge WinTV USB 2 (em2840) and the chip/eeprom audio config 0x20 matches the sample rates reproted by the USB device descriptor (32k only). Signed-off-by: Frank Schäfer fschaefer@googlemail.com --- drivers/media/usb/em28xx/em28xx-core.c | 24 +--- drivers/media/usb/em28xx/em28xx-i2c.c | 10 -- drivers/media/usb/em28xx/em28xx-reg.h | 10 ++ drivers/media/usb/em28xx/em28xx.h |3 +-- 4 Dateien geändert, 28 Zeilen hinzugefügt(+), 19 Zeilen entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index f6076a5..192b657 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -525,17 +525,19 @@ int em28xx_audio_setup(struct em28xx *dev) dev-has_alsa_audio = false; dev-audio_mode.has_audio = false; return 0; - } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == -EM28XX_CHIPCFG_I2S_3_SAMPRATES) { - em28xx_info(I2S Audio (3 sample rates)\n); - dev-audio_mode.i2s_3rates = 1; - } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == -EM28XX_CHIPCFG_I2S_5_SAMPRATES) { - em28xx_info(I2S Audio (5 sample rates)\n); - dev-audio_mode.i2s_5rates = 1; - } - - if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { + } else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { + if (dev-chip_id CHIP_ID_EM2860 + (cfg EM28XX_CHIPCFG_AUDIOMASK) == + EM2820_CHIPCFG_I2S_1_SAMPRATE) + dev-audio_mode.i2s_samplerates = 1; No need to store it at all, as, at least currently, this is not used anywhere. This patch could be useful if we could use this to improve em28xx-audio.c. Otherwise, I would just drop the code that checks it, eventually just keeping the registers at em28xx-reg.h + else if (dev-chip_id = CHIP_ID_EM2860 + (cfg EM28XX_CHIPCFG_AUDIOMASK) == + EM2860_CHIPCFG_I2S_5_SAMPRATES) + dev-audio_mode.i2s_samplerates = 5; + else + dev-audio_mode.i2s_samplerates = 3; + em28xx_info(I2S Audio (%d sample rate(s))\n, +dev-audio_mode.i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev-audio_mode.ac97 = EM28XX_NO_AC97; goto init_audio; diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index c4ff973..f2d5f8a 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -736,10 +736,16 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, em28xx_info(\tAC97 audio (5 sample rates)\n); break; case 2: - em28xx_info(\tI2S audio, sample rate=32k\n); + if (dev-chip_id CHIP_ID_EM2860) + em28xx_info(\tI2S audio, sample rate=32k\n); + else + em28xx_info(\tI2S audio, 3 sample rates\n); break; case 3: - em28xx_info(\tI2S audio, 3 sample rates\n); + if (dev-chip_id CHIP_ID_EM2860) + em28xx_info(\tI2S audio, 3 sample rates\n); + else + em28xx_info(\tI2S audio, 5 sample rates\n); break; } diff --git a/drivers/media/usb/em28xx/em28xx-reg.h b/drivers/media/usb/em28xx/em28xx-reg.h index b769ceb..311fb34 100644 --- a/drivers/media/usb/em28xx/em28xx-reg.h +++ b/drivers/media/usb/em28xx/em28xx-reg.h @@ -25,10 +25,12 @@ #define EM28XX_R00_CHIPCFG 0x00 /* em28xx Chip Configuration 0x00 */ -#define EM28XX_CHIPCFG_VENDOR_AUDIO 0x80 -#define EM28XX_CHIPCFG_I2S_VOLUME_CAPABLE0x40 -#define EM28XX_CHIPCFG_I2S_5_SAMPRATES 0x30 -#define EM28XX_CHIPCFG_I2S_3_SAMPRATES 0x20 +#define EM2860_CHIPCFG_VENDOR_AUDIO 0x80 +#define EM2860_CHIPCFG_I2S_VOLUME_CAPABLE0x40 +#define EM2820_CHIPCFG_I2S_3_SAMPRATES 0x30 +#define EM2860_CHIPCFG_I2S_5_SAMPRATES 0x30 +#define EM2820_CHIPCFG_I2S_1_SAMPRATE0x20
Re: [PATCH] em28xx: fix I2S audio sample rate definitions and info output
Am 22.12.2013 17:09, schrieb Mauro Carvalho Chehab: Em Sun, 22 Dec 2013 15:17:46 +0100 Frank Schäfer fschaefer@googlemail.com escreveu: The audio configuration in chip config register 0x00 and eeprom are always consistent. But currently the audio configuration #defines for the chip config register say 0x20 means 3 sample rates and 0x30 5 sample rates, while the eeprom info output says 0x20 means 1 sample rate and 0x30 3 sample rates. I've checked the datasheet excerpts I have and it seems that the meaning of these bits is different for em2820/40 (1 and 3 sample rates) and em2860+ (3 and 5 smaple rates). I have also checked my Hauppauge WinTV USB 2 (em2840) and the chip/eeprom audio config 0x20 matches the sample rates reproted by the USB device descriptor (32k only). Signed-off-by: Frank Schäfer fschaefer@googlemail.com --- drivers/media/usb/em28xx/em28xx-core.c | 24 +--- drivers/media/usb/em28xx/em28xx-i2c.c | 10 -- drivers/media/usb/em28xx/em28xx-reg.h | 10 ++ drivers/media/usb/em28xx/em28xx.h |3 +-- 4 Dateien geändert, 28 Zeilen hinzugefügt(+), 19 Zeilen entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index f6076a5..192b657 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -525,17 +525,19 @@ int em28xx_audio_setup(struct em28xx *dev) dev-has_alsa_audio = false; dev-audio_mode.has_audio = false; return 0; -} else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_3_SAMPRATES) { -em28xx_info(I2S Audio (3 sample rates)\n); -dev-audio_mode.i2s_3rates = 1; -} else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_5_SAMPRATES) { -em28xx_info(I2S Audio (5 sample rates)\n); -dev-audio_mode.i2s_5rates = 1; -} - -if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { +} else if ((cfg EM28XX_CHIPCFG_AUDIOMASK) != EM28XX_CHIPCFG_AC97) { +if (dev-chip_id CHIP_ID_EM2860 +(cfg EM28XX_CHIPCFG_AUDIOMASK) == +EM2820_CHIPCFG_I2S_1_SAMPRATE) +dev-audio_mode.i2s_samplerates = 1; No need to store it at all, as, at least currently, this is not used anywhere. Yes, and the same applies to most other members of struct em28xx_audio_mode. ;) I'm currently looking deep into the audio code and the whole thing seems to be hopelessly messed up. The plan is to send a separate patch that cleans up the audio structures and variables later when I'm sure which way to go to fix things. Would that be ok for you or do you want me to drop the samplerate fields now ? Regards, Frank This patch could be useful if we could use this to improve em28xx-audio.c. Otherwise, I would just drop the code that checks it, eventually just keeping the registers at em28xx-reg.h +else if (dev-chip_id = CHIP_ID_EM2860 + (cfg EM28XX_CHIPCFG_AUDIOMASK) == + EM2860_CHIPCFG_I2S_5_SAMPRATES) +dev-audio_mode.i2s_samplerates = 5; +else +dev-audio_mode.i2s_samplerates = 3; +em28xx_info(I2S Audio (%d sample rate(s))\n, + dev-audio_mode.i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev-audio_mode.ac97 = EM28XX_NO_AC97; goto init_audio; diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index c4ff973..f2d5f8a 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -736,10 +736,16 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, em28xx_info(\tAC97 audio (5 sample rates)\n); break; case 2: -em28xx_info(\tI2S audio, sample rate=32k\n); +if (dev-chip_id CHIP_ID_EM2860) +em28xx_info(\tI2S audio, sample rate=32k\n); +else +em28xx_info(\tI2S audio, 3 sample rates\n); break; case 3: -em28xx_info(\tI2S audio, 3 sample rates\n); +if (dev-chip_id CHIP_ID_EM2860) +em28xx_info(\tI2S audio, 3 sample rates\n); +else +em28xx_info(\tI2S audio, 5 sample rates\n); break; } diff --git a/drivers/media/usb/em28xx/em28xx-reg.h b/drivers/media/usb/em28xx/em28xx-reg.h index b769ceb..311fb34 100644 --- a/drivers/media/usb/em28xx/em28xx-reg.h +++ b/drivers/media/usb/em28xx/em28xx-reg.h @@ -25,10 +25,12 @@ #define EM28XX_R00_CHIPCFG 0x00 /* em28xx Chip Configuration 0x00 */ -#define EM28XX_CHIPCFG_VENDOR_AUDIO 0x80 -#define
Re: [PATCH 2/3] [media] siano: Improve debug/info messages
On Thu, 12 Sep 2013 16:59:59 -0300 Mauro Carvalho Chehab m.che...@samsung.com wrote: Tested-by: André Roth neol...@gmail.com Some messages are not clear, some are debug data, but are shown as errors, and one message is duplicated. Cleanup that mess in order to provide a cleaner log. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/siano/smsusb.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 03761c6..74236b8 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -209,8 +209,10 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size) struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; int dummy; - if (dev-state != SMSUSB_ACTIVE) + if (dev-state != SMSUSB_ACTIVE) { + sms_debug(Device not active yet); return -ENOENT; + } sms_debug(sending %s(%d) size: %d, smscore_translate_msg(phdr-msg_type), phdr-msg_type, @@ -445,14 +447,15 @@ static int smsusb_probe(struct usb_interface *intf, char devpath[32]; int i, rc; - sms_info(interface number %d, + sms_info(board id=%lu, interface number %d, + id-driver_info, intf-cur_altsetting-desc.bInterfaceNumber); if (sms_get_board(id-driver_info)-intf_num != intf-cur_altsetting-desc.bInterfaceNumber) { - sms_err(interface number is %d expecting %d, - sms_get_board(id-driver_info)-intf_num, - intf-cur_altsetting-desc.bInterfaceNumber); + sms_debug(interface %d won't be used. Expecting interface %d to popup, + intf-cur_altsetting-desc.bInterfaceNumber, + sms_get_board(id-driver_info)-intf_num); return -ENODEV; } @@ -483,12 +486,11 @@ static int smsusb_probe(struct usb_interface *intf, } if ((udev-actconfig-desc.bNumInterfaces == 2) (intf-cur_altsetting-desc.bInterfaceNumber == 0)) { - sms_err(rom interface 0 is not used); + sms_debug(rom interface 0 is not used); return -ENODEV; } if (id-driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) { - sms_info(stellar device was found.); snprintf(devpath, sizeof(devpath), usb\\%d-%s, udev-bus-busnum, udev-devpath); sms_info(stellar device was found.); @@ -498,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf, } rc = smsusb_init_device(intf, id-driver_info); - sms_info(rc %d, rc); + sms_info(Device initialized with return code %d, rc); sms_board_load_modules(id-driver_info); return rc; } -- 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 2/3] [media] siano: Improve debug/info messages
Some messages are not clear, some are debug data, but are shown as errors, and one message is duplicated. Cleanup that mess in order to provide a cleaner log. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/siano/smsusb.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index 03761c6..74236b8 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -209,8 +209,10 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size) struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer; int dummy; - if (dev-state != SMSUSB_ACTIVE) + if (dev-state != SMSUSB_ACTIVE) { + sms_debug(Device not active yet); return -ENOENT; + } sms_debug(sending %s(%d) size: %d, smscore_translate_msg(phdr-msg_type), phdr-msg_type, @@ -445,14 +447,15 @@ static int smsusb_probe(struct usb_interface *intf, char devpath[32]; int i, rc; - sms_info(interface number %d, + sms_info(board id=%lu, interface number %d, +id-driver_info, intf-cur_altsetting-desc.bInterfaceNumber); if (sms_get_board(id-driver_info)-intf_num != intf-cur_altsetting-desc.bInterfaceNumber) { - sms_err(interface number is %d expecting %d, - sms_get_board(id-driver_info)-intf_num, - intf-cur_altsetting-desc.bInterfaceNumber); + sms_debug(interface %d won't be used. Expecting interface %d to popup, + intf-cur_altsetting-desc.bInterfaceNumber, + sms_get_board(id-driver_info)-intf_num); return -ENODEV; } @@ -483,12 +486,11 @@ static int smsusb_probe(struct usb_interface *intf, } if ((udev-actconfig-desc.bNumInterfaces == 2) (intf-cur_altsetting-desc.bInterfaceNumber == 0)) { - sms_err(rom interface 0 is not used); + sms_debug(rom interface 0 is not used); return -ENODEV; } if (id-driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) { - sms_info(stellar device was found.); snprintf(devpath, sizeof(devpath), usb\\%d-%s, udev-bus-busnum, udev-devpath); sms_info(stellar device was found.); @@ -498,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf, } rc = smsusb_init_device(intf, id-driver_info); - sms_info(rc %d, rc); + sms_info(Device initialized with return code %d, rc); sms_board_load_modules(id-driver_info); return rc; } -- 1.8.3.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 v3 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
Add hwmod data for the VPE IP, this is needed for the IP to be reset during boot, and control the functional clock when the driver needs it via pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's ocp interface list. Cc: Rajendra Nayak rna...@ti.com Cc: Sricharan R r.sricha...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index f647998b..181365d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = { }, }; +/* + * 'vpe' class + * + */ + +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = { + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = { + .name = vpe, + .sysc = dra7xx_vpe_sysc, +}; + +/* vpe */ +static struct omap_hwmod dra7xx_vpe_hwmod = { + .name = vpe, + .class = dra7xx_vpe_hwmod_class, + .clkdm_name = vpe_clkdm, + .main_clk = dpll_core_h23x2_ck, + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET, + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; /* * Interfaces @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l4_per3 - vpe */ +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = { + .master = dra7xx_l4_per3_hwmod, + .slave = dra7xx_vpe_hwmod, + .clk= l3_iclk_div, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_2__l3_instr, dra7xx_l4_cfg__l3_main_1, @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_1__vcp2, dra7xx_l4_per2__vcp2, dra7xx_l4_wkup__wd_timer2, + dra7xx_l4_per3__vpe, NULL, }; -- 1.8.1.2 -- 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 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
Archit, On Thursday 29 August 2013 06:02 PM, Archit Taneja wrote: Add hwmod data for the VPE IP, this is needed for the IP to be reset during boot, and control the functional clock when the driver needs it via pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's ocp interface list. You need to swap patches 5/6 and 6/6 to maintain git-bisect. Thats needed because after $subject patch, hwmod wouldn't find the register iospace and crash, and thats added only in patch 6/6. regards, Rajendra Cc: Rajendra Nayak rna...@ti.com Cc: Sricharan R r.sricha...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index f647998b..181365d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = { }, }; +/* + * 'vpe' class + * + */ + +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = { + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | +SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | +MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = { + .name = vpe, + .sysc = dra7xx_vpe_sysc, +}; + +/* vpe */ +static struct omap_hwmod dra7xx_vpe_hwmod = { + .name = vpe, + .class = dra7xx_vpe_hwmod_class, + .clkdm_name = vpe_clkdm, + .main_clk = dpll_core_h23x2_ck, + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET, + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; /* * Interfaces @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l4_per3 - vpe */ +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = { + .master = dra7xx_l4_per3_hwmod, + .slave = dra7xx_vpe_hwmod, + .clk= l3_iclk_div, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_2__l3_instr, dra7xx_l4_cfg__l3_main_1, @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_1__vcp2, dra7xx_l4_per2__vcp2, dra7xx_l4_wkup__wd_timer2, + dra7xx_l4_per3__vpe, NULL, }; -- 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 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
On Thursday 29 August 2013 06:12 PM, Rajendra Nayak wrote: Archit, On Thursday 29 August 2013 06:02 PM, Archit Taneja wrote: Add hwmod data for the VPE IP, this is needed for the IP to be reset during boot, and control the functional clock when the driver needs it via pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's ocp interface list. You need to swap patches 5/6 and 6/6 to maintain git-bisect. Thats needed because after $subject patch, hwmod wouldn't find the register iospace and crash, and thats added only in patch 6/6. That's a good point, I'll take care of this. Thanks, Archit regards, Rajendra Cc: Rajendra Nayak rna...@ti.com Cc: Sricharan R r.sricha...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index f647998b..181365d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = { }, }; +/* + * 'vpe' class + * + */ + +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = { + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = { + .name = vpe, + .sysc = dra7xx_vpe_sysc, +}; + +/* vpe */ +static struct omap_hwmod dra7xx_vpe_hwmod = { + .name = vpe, + .class = dra7xx_vpe_hwmod_class, + .clkdm_name = vpe_clkdm, + .main_clk = dpll_core_h23x2_ck, + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET, + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; /* * Interfaces @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l4_per3 - vpe */ +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = { + .master = dra7xx_l4_per3_hwmod, + .slave = dra7xx_vpe_hwmod, + .clk= l3_iclk_div, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_2__l3_instr, dra7xx_l4_cfg__l3_main_1, @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_1__vcp2, dra7xx_l4_per2__vcp2, dra7xx_l4_wkup__wd_timer2, + dra7xx_l4_per3__vpe, NULL, }; -- 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 v2 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
Add hwmod data for the VPE IP, this is needed for the IP to be reset during boot, and control the functional clock when the driver needs it via pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's ocp interface list. Cc: Rajendra Nayak rna...@ti.com Cc: Sricharan R r.sricha...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index f647998b..181365d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = { }, }; +/* + * 'vpe' class + * + */ + +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = { + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = { + .name = vpe, + .sysc = dra7xx_vpe_sysc, +}; + +/* vpe */ +static struct omap_hwmod dra7xx_vpe_hwmod = { + .name = vpe, + .class = dra7xx_vpe_hwmod_class, + .clkdm_name = vpe_clkdm, + .main_clk = dpll_core_h23x2_ck, + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET, + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; /* * Interfaces @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l4_per3 - vpe */ +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = { + .master = dra7xx_l4_per3_hwmod, + .slave = dra7xx_vpe_hwmod, + .clk= l3_iclk_div, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_2__l3_instr, dra7xx_l4_cfg__l3_main_1, @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_1__vcp2, dra7xx_l4_per2__vcp2, dra7xx_l4_wkup__wd_timer2, + dra7xx_l4_per3__vpe, NULL, }; -- 1.8.1.2 -- 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 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
Add hwmod data for the VPE IP, this is needed for the IP to be reset during boot, and control the functional clock when the driver needs it via pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's ocp interface list. Cc: Rajendra Nayak rna...@ti.com Cc: Sricharan R r.sricha...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index f647998b..181365d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = { }, }; +/* + * 'vpe' class + * + */ + +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = { + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = { + .name = vpe, + .sysc = dra7xx_vpe_sysc, +}; + +/* vpe */ +static struct omap_hwmod dra7xx_vpe_hwmod = { + .name = vpe, + .class = dra7xx_vpe_hwmod_class, + .clkdm_name = vpe_clkdm, + .main_clk = dpll_core_h23x2_ck, + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET, + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; /* * Interfaces @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l4_per3 - vpe */ +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = { + .master = dra7xx_l4_per3_hwmod, + .slave = dra7xx_vpe_hwmod, + .clk= l3_iclk_div, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_2__l3_instr, dra7xx_l4_cfg__l3_main_1, @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { dra7xx_l3_main_1__vcp2, dra7xx_l4_per2__vcp2, dra7xx_l4_wkup__wd_timer2, + dra7xx_l4_per3__vpe, NULL, }; -- 1.8.1.2 -- 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] bt8xx: info leak in ca_get_slot_info()
p_ca_slot_info was allocated with kmalloc() so we need to clear it before passing it to the user. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index 0e788fc..6b9dc3f 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -302,8 +302,11 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s p_ca_slot_info-flags = CA_CI_MODULE_READY; p_ca_slot_info-num = 1; p_ca_slot_info-type = CA_CI; - } else + } else { p_ca_slot_info-flags = 0; + p_ca_slot_info-num = 0; + p_ca_slot_info-type = 0; + } if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info))) return -EFAULT; -- 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] [media] bt8xx: info leak in ca_get_slot_info()
Am 25.07.2013 18:46, schrieb Dan Carpenter: p_ca_slot_info was allocated with kmalloc() so we need to clear it before passing it to the user. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index 0e788fc..6b9dc3f 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -302,8 +302,11 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s p_ca_slot_info-flags = CA_CI_MODULE_READY; p_ca_slot_info-num = 1; p_ca_slot_info-type = CA_CI; - } else + } else { p_ca_slot_info-flags = 0; + p_ca_slot_info-num = 0; + p_ca_slot_info-type = 0; + } if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info))) return -EFAULT; note: i have no clue how p_ca_slot_info looks like, but to avoid information leaks via compiler padding etc. i could be more wise to do a memset(p_ca_slot_info,0,sizeof (struct ca_slot_info)) and then set the p_ca_slot_info-flags = CA_CI_MODULE_READY; p_ca_slot_info-num = 1; p_ca_slot_info-type = CA_CI; just my 2 cents, re, wh -- 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] [media] bt8xx: info leak in ca_get_slot_info()
On Thu, Jul 25, 2013 at 07:29:09PM +0200, walter harms wrote: Am 25.07.2013 18:46, schrieb Dan Carpenter: p_ca_slot_info was allocated with kmalloc() so we need to clear it before passing it to the user. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index 0e788fc..6b9dc3f 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -302,8 +302,11 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s p_ca_slot_info-flags = CA_CI_MODULE_READY; p_ca_slot_info-num = 1; p_ca_slot_info-type = CA_CI; - } else + } else { p_ca_slot_info-flags = 0; + p_ca_slot_info-num = 0; + p_ca_slot_info-type = 0; + } if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info))) return -EFAULT; note: i have no clue how p_ca_slot_info looks like, but to avoid information leaks via compiler padding etc. i could be more wise to do a memset(p_ca_slot_info,0,sizeof (struct ca_slot_info)) and then set the There is no compiler padding. My static checker looks for that. 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] mxl111sf: don't redefine pr_err/info/debug
eek... I'd rather merge it than ack it -- why don't I see it in patchwork? I'll try to merge it tonight or tomorrow. Cheers, Mike On Thu, Jun 13, 2013 at 2:09 AM, Hans Verkuil hverk...@xs4all.nl wrote: On Thu May 23 2013 08:50:43 Hans Verkuil wrote: Remove the silly redefines of pr_err/info/debug. This improves readability and it also gets rid of a bunch of warnings when compiling this driver for older kernels using the compatibility media_build system. Mike, Can you Ack this? Thanks, Hans Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c |8 +-- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 90 - 2 files changed, 45 insertions(+), 53 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c index ef4c65f..879c529 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c @@ -31,8 +31,6 @@ MODULE_PARM_DESC(debug, set debugging level (1=info (or-able)).); if (mxl111sf_tuner_debug) \ mxl_printk(KERN_DEBUG, fmt, ##arg) -#define err pr_err - /* */ struct mxl111sf_tuner_state { @@ -113,7 +111,7 @@ static struct mxl111sf_reg_ctrl_info *mxl111sf_calc_phy_tune_regs(u32 freq, filt_bw = 63; break; default: - err(%s: invalid bandwidth setting!, __func__); + pr_err(%s: invalid bandwidth setting!, __func__); return NULL; } @@ -304,12 +302,12 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe) bw = 8; break; default: - err(%s: bandwidth not set!, __func__); + pr_err(%s: bandwidth not set!, __func__); return -EINVAL; } break; default: - err(%s: modulation type not supported!, __func__); + pr_err(%s: modulation type not supported!, __func__); return -EINVAL; } ret = mxl1x1sf_tune_rf(fe, c-frequency, bw); diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index efdcb15..e97964e 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c @@ -52,12 +52,6 @@ MODULE_PARM_DESC(rfswitch, force rf switch position (0=auto, 1=ext, 2=int).); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); -#define deb_info pr_debug -#define deb_reg pr_debug -#define deb_adv pr_debug -#define err pr_err -#define info pr_info - int mxl111sf_ctrl_msg(struct dvb_usb_device *d, u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { @@ -65,7 +59,7 @@ int mxl111sf_ctrl_msg(struct dvb_usb_device *d, int ret; u8 sndbuf[1+wlen]; - deb_adv(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen); + pr_debug(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen); memset(sndbuf, 0, 1+wlen); @@ -98,12 +92,12 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data) if (buf[0] == addr) *data = buf[1]; else { - err(invalid response reading reg: 0x%02x != 0x%02x, 0x%02x, + pr_err(invalid response reading reg: 0x%02x != 0x%02x, 0x%02x, addr, buf[0], buf[1]); ret = -EINVAL; } - deb_reg(R: (0x%02x, 0x%02x)\n, addr, *data); + pr_debug(R: (0x%02x, 0x%02x)\n, addr, *data); fail: return ret; } @@ -113,11 +107,11 @@ int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data) u8 buf[] = { addr, data }; int ret; - deb_reg(W: (0x%02x, 0x%02x)\n, addr, data); + pr_debug(W: (0x%02x, 0x%02x)\n, addr, data); ret = mxl111sf_ctrl_msg(state-d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0); if (mxl_fail(ret)) - err(error writing reg: 0x%02x, val: 0x%02x, addr, data); + pr_err(error writing reg: 0x%02x, val: 0x%02x, addr, data); return ret; } @@ -134,7 +128,7 @@ int mxl111sf_write_reg_mask(struct mxl111sf_state *state, #if 1 /* dont know why this usually errors out on the first try */ if (mxl_fail(ret)) - err(error writing addr: 0x%02x, mask: 0x%02x, + pr_err(error writing addr: 0x%02x, mask: 0x%02x, data: 0x%02x, retrying..., addr, mask, data); ret = mxl111sf_read_reg(state, addr, val); @@ -167,7 +161,7 @@ int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state, ctrl_reg_info[i].mask, ctrl_reg_info[i].data); if (mxl_fail(ret
Re: [PATCH] mxl111sf: don't redefine pr_err/info/debug
On Thu May 23 2013 08:50:43 Hans Verkuil wrote: Remove the silly redefines of pr_err/info/debug. This improves readability and it also gets rid of a bunch of warnings when compiling this driver for older kernels using the compatibility media_build system. Mike, Can you Ack this? Thanks, Hans Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c |8 +-- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 90 - 2 files changed, 45 insertions(+), 53 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c index ef4c65f..879c529 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c @@ -31,8 +31,6 @@ MODULE_PARM_DESC(debug, set debugging level (1=info (or-able)).); if (mxl111sf_tuner_debug) \ mxl_printk(KERN_DEBUG, fmt, ##arg) -#define err pr_err - /* */ struct mxl111sf_tuner_state { @@ -113,7 +111,7 @@ static struct mxl111sf_reg_ctrl_info *mxl111sf_calc_phy_tune_regs(u32 freq, filt_bw = 63; break; default: - err(%s: invalid bandwidth setting!, __func__); + pr_err(%s: invalid bandwidth setting!, __func__); return NULL; } @@ -304,12 +302,12 @@ static int mxl111sf_tuner_set_params(struct dvb_frontend *fe) bw = 8; break; default: - err(%s: bandwidth not set!, __func__); + pr_err(%s: bandwidth not set!, __func__); return -EINVAL; } break; default: - err(%s: modulation type not supported!, __func__); + pr_err(%s: modulation type not supported!, __func__); return -EINVAL; } ret = mxl1x1sf_tune_rf(fe, c-frequency, bw); diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index efdcb15..e97964e 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c @@ -52,12 +52,6 @@ MODULE_PARM_DESC(rfswitch, force rf switch position (0=auto, 1=ext, 2=int).); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); -#define deb_info pr_debug -#define deb_reg pr_debug -#define deb_adv pr_debug -#define err pr_err -#define info pr_info - int mxl111sf_ctrl_msg(struct dvb_usb_device *d, u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { @@ -65,7 +59,7 @@ int mxl111sf_ctrl_msg(struct dvb_usb_device *d, int ret; u8 sndbuf[1+wlen]; - deb_adv(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen); + pr_debug(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen); memset(sndbuf, 0, 1+wlen); @@ -98,12 +92,12 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data) if (buf[0] == addr) *data = buf[1]; else { - err(invalid response reading reg: 0x%02x != 0x%02x, 0x%02x, + pr_err(invalid response reading reg: 0x%02x != 0x%02x, 0x%02x, addr, buf[0], buf[1]); ret = -EINVAL; } - deb_reg(R: (0x%02x, 0x%02x)\n, addr, *data); + pr_debug(R: (0x%02x, 0x%02x)\n, addr, *data); fail: return ret; } @@ -113,11 +107,11 @@ int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data) u8 buf[] = { addr, data }; int ret; - deb_reg(W: (0x%02x, 0x%02x)\n, addr, data); + pr_debug(W: (0x%02x, 0x%02x)\n, addr, data); ret = mxl111sf_ctrl_msg(state-d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0); if (mxl_fail(ret)) - err(error writing reg: 0x%02x, val: 0x%02x, addr, data); + pr_err(error writing reg: 0x%02x, val: 0x%02x, addr, data); return ret; } @@ -134,7 +128,7 @@ int mxl111sf_write_reg_mask(struct mxl111sf_state *state, #if 1 /* dont know why this usually errors out on the first try */ if (mxl_fail(ret)) - err(error writing addr: 0x%02x, mask: 0x%02x, + pr_err(error writing addr: 0x%02x, mask: 0x%02x, data: 0x%02x, retrying..., addr, mask, data); ret = mxl111sf_read_reg(state, addr, val); @@ -167,7 +161,7 @@ int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state, ctrl_reg_info[i].mask, ctrl_reg_info[i].data); if (mxl_fail(ret)) { - err(failed on reg #%d (0x%02x), i, + pr_err(failed on reg #%d (0x%02x), i, ctrl_reg_info[i].addr); break
Re: [patch] [media] media: info leak in __media_device_enum_links()
Hi Dan, On Friday 31 May 2013 15:24:45 Dan Carpenter wrote: Ping? Oops, sorry for having missed the patch. On Sat, Apr 13, 2013 at 12:32:15PM +0300, Dan Carpenter wrote: These structs have holes and reserved struct members which aren't cleared. I've added a memset() so we don't leak stack information. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com I've taken the patch in my tree, Added a CC: sta...@vger.kernel.org and issued a pull request. diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 99b80b6..450c0d1 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -139,6 +139,8 @@ static long __media_device_enum_links(struct media_device *mdev, for (p = 0; p entity-num_pads; p++) { struct media_pad_desc pad; + + memset(pad, 0, sizeof(pad)); media_device_kpad_to_upad(entity-pads[p], pad); if (copy_to_user(links-pads[p], pad, sizeof(pad))) return -EFAULT; @@ -156,6 +158,7 @@ static long __media_device_enum_links(struct media_device *mdev, if (entity-links[l].source-entity != entity) continue; + memset(link, 0, sizeof(link)); media_device_kpad_to_upad(entity-links[l].source, link.source); media_device_kpad_to_upad(entity-links[l].sink, -- 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
[RFC PATCHv2 2/3] rds-ctl: support RDS-EON and TMC-tuning info
Signed-off-by: Konke Radlow korad...@gmail.com rds-ctl.cpp: added functionality to print RDS-EON information Signed-off-by: Konke Radlow korad...@gmail.com rds-ctl.cpp: added functionality to print RDS-TMC tuning information Signed-off-by: Konke Radlow korad...@gmail.com rds-ctl.cpp: clarify option description, change trigger condition for printing TMC Tuning information Signed-off-by: Konke Radlow korad...@gmail.com --- utils/rds-ctl/rds-ctl.cpp | 59 +++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index 191cfee..d894ec1 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -130,7 +130,7 @@ static void usage_hint(void) static void usage_common(void) { printf(\nGeneral/Common options:\n ---all display all information available\n +--all display all device information available\n -D, --info show driver info [VIDIOC_QUERYCAP]\n -d, --device=dev use device dev\n if dev is a single digit, then /dev/radiodev is used\n @@ -172,7 +172,7 @@ static void usage_rds(void) default: 5000 ms\n --print-block prints all valid RDS fields, whenever a value is updated\n instead of printing only updated values\n ---tmc enables decoding of TMC (Traffic Message Channel) data\n +--tmc print information about TMC (Traffic Message Channel) messages\n --silent only set the result code, do not print any messages\n --verbose turn on verbose mode - every received RDS group\n will be printed\n @@ -517,6 +517,30 @@ static void print_rds_tmc(const struct v4l2_rds *handle, uint32_t updated_fields } } +static void print_rds_tmc_tuning(const struct v4l2_rds *handle, uint32_t updated_fields) +{ + const struct v4l2_tmc_tuning *tuning = handle-tmc.tuning; + const struct v4l2_tmc_station *station; + + if (updated_fields V4L2_RDS_TMC_TUNING) { + printf(\nTMC Service provider: %s, %u alternative stations\n, handle-tmc.spn, tuning-station_cnt); + for (int i = 0; i tuning-station_cnt; i++) { + station = tuning-station[i]; + printf(PI(ON %02u) = %04x, AFs: %u, mapped AFs: %u \n, i, station-pi, + station-afi.af_size, station-afi.mapped_af_size); + for (int j = 0; j station-afi.af_size; j++) + printf(AF%02d: %.1fMHz\n, j, station-afi.af[j] / 100.0); + for (int k = 0; k station-afi.mapped_af_size; k++) + printf(m_AF%02d: %.1fMHz = %.1fMHz\n, k, + station-afi.mapped_af_tuning[k] / 100.0, + station-afi.mapped_af[k] / 100.0); + if (station-ltn != 0 || station-msg != 0 || station- sid != 0) + printf(ltn: %02x, msg: %02x, sid: %02x\n, station-ltn, + station-msg, station-sid); + } + } +} + static void print_rds_statistics(const struct v4l2_rds_statistics *statistics) { printf(\n\nRDS Statistics: \n); @@ -557,6 +581,33 @@ static void print_rds_af(const struct v4l2_rds_af_set *af_set) } } +static void print_rds_eon(const struct v4l2_rds_eon_set *eon_set) +{ + int counter = 0; + + printf(\n\nEnhanced Other Network information: %u channels, eon_set-size); + for (int i = 0; i eon_set-size; i++, counter++) { + if (eon_set-eon[i].valid_fields V4L2_RDS_PI) + printf(\nPI(ON %02i) = %04x, i, eon_set-eon[i].pi); + if (eon_set-eon[i].valid_fields V4L2_RDS_PS) + printf(\nPS(ON %02i) = %s, i, eon_set-eon[i].ps); + if (eon_set-eon[i].valid_fields V4L2_RDS_PTY) + printf(\nPTY(ON %02i) = %0u, i, eon_set-eon[i].pty); + if (eon_set-eon[i].valid_fields V4L2_RDS_LSF) + printf(\nLSF(ON %02i) = %0u, i, eon_set-eon[i].lsf); + if (eon_set-eon[i].valid_fields V4L2_RDS_AF) + printf(\nPTY(ON %02i) = %0u, i, eon_set-eon[i].pty); + if (eon_set-eon[i].valid_fields V4L2_RDS_TP) + printf(\nTP(ON %02i): %s, i, eon_set-eon[i].tp? yes:no); + if (eon_set-eon[i].valid_fields V4L2_RDS_TA) + printf(\nTA(ON %02i): %s, i, eon_set-eon[i].tp? yes:no
[RFC PATCHv2 1/3] libv4l2rds: support RDS-EON and TMC-tuning info
Signed-off-by: Konke Radlow korad...@gmail.com libv4l2rds: added support to decode RDS-EON information Signed-off-by: Konke Radlow korad...@gmail.com libv4l2rds: added support to decode RDS-TMC tuning information Signed-off-by: Konke Radlow korad...@gmail.com libv4l2rds.c: fixing compiler warnings due to missing pointer dereferencing and implementing changes proposed in RFC replies (RDS-EON patch) Signed-off-by: Konke Radlow korad...@gmail.com libv4l2rds: implementing changes proposed in RFC replies (TMC-Tuning patch) Signed-off-by: Konke Radlow korad...@gmail.com --- lib/include/libv4l2rds.h| 79 +- lib/libv4l2rds/libv4l2rds.c | 363 --- 2 files changed, 417 insertions(+), 25 deletions(-) diff --git a/lib/include/libv4l2rds.h b/lib/include/libv4l2rds.h index 6a6c7f3..e1078de 100644 --- a/lib/include/libv4l2rds.h +++ b/lib/include/libv4l2rds.h @@ -37,7 +37,7 @@ extern C { #endif /* used to define the current version (version field) of the v4l2_rds struct */ -#define V4L2_RDS_VERSION (1) +#define V4L2_RDS_VERSION (2) /* Constants used to define the size of arrays used to store RDS information */ #define MAX_ODA_CNT 18 /* there are 16 groups each with type a or b. Of these @@ -50,6 +50,16 @@ extern C { * Additional data is limited to 112 bit, and the smallest * optional tuple has a size of 4 bit (4 bit identifier + * 0 bits of data) */ +#define MAX_TMC_ALT_STATIONS 32 /* defined by ISO 14819-1:2003, 7.5.3.3 */ +#define MAX_TMC_AF_CNT 4 /* limit for the numbers of AFs stored per alternative TMC + * station. This value is not defined by the standard, but based on observation + * of real-world RDS-TMC streams. The maximum encountered number of AFs per + * station during testing was 2 */ +#define MAX_EON_CNT 20 /* Maximal number of entries in the EON table (for storing + * information about other radio stations, broadcasted by the current station). + * This value is not defined by the standard, but based on observation + * of real-world RDS-TMC streams. EON doesn't seem to be a widely used feature + * and the maximum number of EON encountered during testing was 8 */ /* Define Constants for the possible types of RDS information * used to address the relevant bit in the valid_fields bitmask */ @@ -69,7 +79,10 @@ extern C { #define V4L2_RDS_LC0x2000 /* Language Code */ #define V4L2_RDS_TMC_SG0x4000 /* RDS-TMC single group */ #define V4L2_RDS_TMC_MG0x8000 /* RDS-TMC multi group */ -#define V4L2_RDS_TMC_SYS 0x1 /* RDS-TMC system information */ +#define V4L2_RDS_TMC_SYS 0x1 /* RDS-TMC system information */ +#define V4L2_RDS_EON 0x2 /* Enhanced Other Network Info */ +#define V4L2_RDS_LSF 0x4 /* Linkage information */ +#define V4L2_RDS_TMC_TUNING0x8 /* RDS-TMC tuning information */ /* Define Constants for the state of the RDS decoding process * used to address the relevant bit in the decode_information bitmask */ @@ -84,9 +97,10 @@ extern C { #define V4L2_RDS_FLAG_STATIC_PTY 0x08 /* TMC related codes - * used to extract TMC fields from RDS groups */ -#define V4L2_TMC_TUNING_INFO 0x08 -#define V4L2_TMC_SINGLE_GROUP 0x04 + * used to extract TMC fields from RDS-TMC groups + * see ISO 14819-1:2003, Figure 2 - RDS-TMC single-grp full message structure */ +#define V4L2_TMC_TUNING_INFO 0x10/* Bit 4 indicates Tuning Info / User msg */ +#define V4L2_TMC_SINGLE_GROUP 0x08/* Bit 3 indicates Single / Multi-group msg */ /* struct to encapsulate one complete RDS group */ /* This structure is used internally to store data until a complete RDS @@ -149,6 +163,57 @@ struct v4l2_rds_af_set { uint32_t af[MAX_AF_CNT];/* AFs defined in Hz */ }; +/* struct to encapsulate one entry in the EON table (Enhanced Other Network) */ +struct v4l2_rds_eon { + uint32_t valid_fields; + uint16_t pi; + uint8_t ps[9]; + uint8_t pty; + bool ta; + bool tp; + uint16_t lsf; /* Linkage Set Number */ + struct v4l2_rds_af_set af; +}; + +/* struct to encapsulate a table of EON information */ +struct v4l2_rds_eon_set { + uint8_t size; /* size of the table */ + uint8_t index; /* current position in the table */ + struct v4l2_rds_eon eon[MAX_EON_CNT]; /* Information about other +* radio channels */ +}; + +/* struct to encapsulate alternative frequencies (AFs) for RDS-TMC stations. + * AFs listed in af[] can be used unconditionally. + * AFs listed in mapped_af[n] should only be used if the current + * tuner frequency matches the value