Re: OMAP4 support
Hi Gary, On Fri, Jul 13, 2012 at 5:24 AM, Gary Thomas wrote: > On 2012-07-12 20:30, Sergio Aguirre wrote: >> >> Hi Gary, >> >> On Tue, Jul 10, 2012 at 2:31 PM, Gary Thomas wrote: >>> >>> On 2012-07-10 11:05, Chris Lalancette wrote: >>>> >>>> >>>> On Tue, Jul 10, 2012 at 9:41 AM, Gary Thomas wrote: >>>>> >>>>> >>>>> I'm looking for video support on OMAP4 platforms. I've found the >>>>> PandaBoard camera project >>>>> (http://www.omappedia.org/wiki/PandaBoard_Camera_Support) >>>>> and this is starting to work. That said, I'm having some >>>>> issues with setting up the pipeline, etc. >>>>> >>>>> Can this list help out? >>>> >>>> >>>> >>>> I'm not sure exactly what kind of cameras you want to get working, but >>>> if you are looking to get CSI2 cameras going through the ISS, Sergio >>>> Aguirre has been working on support. He also works on the media-ctl >>>> tool, which is used for configuring the media framework pipeline. The >>>> latest versions that I am aware of are here: >>>> >>>> git://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera.git >>> >>> >>> >>> Yes, this is the tree I've been working with (pointed to by the page I >>> mentioned). >>> >>> My kernel can see the camera OV5650 and set up the pipeline. I am able >>> to >>> grab >>> the raw SGRBG10 data but I'd like to get the ISS to convert this to a >>> more >>> usable >>> UYVY format. Here's what I tried: >>>media-ctl -r >>>media-ctl -l '"OMAP4 ISS CSI2a":1 -> "OMAP4 ISS ISP IPIPEIF":0 [1]' >>>media-ctl -l '"OMAP4 ISS ISP IPIPEIF":1 -> "OMAP4 ISS ISP IPIPEIF >>> output":0 [1]' >>>media-ctl -f '"ov5650 3-0036":0 [SGRBG10 2592x1944]' >>>media-ctl -f '"OMAP4 ISS CSI2a":0 [SGRBG10 2592x1944]' >>>media-ctl -f '"OMAP4 ISS ISP IPIPEIF":0 [SGRBG10 2592x1944]','"OMAP4 >>> ISS >>> ISP IPIPEIF":1 [UYVY 2592x1944]' >>> >>> Sadly, I can't get the IPIPEIF element to take SGRGB10 in and put UYVY >>> out >>> (my reading >>> of the manual implies that this _should_ be possible). I always see this >>> pipeline setup: >>> - entity 5: OMAP4 ISS ISP IPIPEIF (3 pads, 4 links) >>> type V4L2 subdev subtype Unknown >>> device node name /dev/v4l-subdev2 >>> pad0: Input [SGRBG10 2592x1944] >>> <- 'OMAP4 ISS CSI2a':pad1 [ACTIVE] >>> <- 'OMAP4 ISS CSI2b':pad1 [] >>> pad1: Output [SGRBG10 2592x1944] >>> -> 'OMAP4 ISS ISP IPIPEIF output':pad0 [ACTIVE] >>> pad2: Output [SGRBG10 2592x1944] >>> -> 'OMAP4 ISS ISP resizer':pad0 [] >>> >>> Am I missing something? How can I make this conversion in the ISS? >> >> >> The core problem is that, i haven't published any support for >> RAW10->YUV conversion, >> which is part of the IPIPE module (not the IPIPEIF, like you mention). I >> had >> some patches, but sadly it is unfinished work. :/ >> >> Now, there's a main non-technical problem... I no longer work at TI >> since end of June >> this year, and I don't have the right HW setup available anymore. >> Those sensors were >> company's asset, and I couldn't keep any. >> >> Now, we can make this work with cooperation of someone who has the right >> setup, >> and me sharing my patches and some advice on my experience. >> >> What do you think? >> >>> >>> Note: if this is not the appropriate place to ask these questions, please >>> redirect me (hopefully to a useful list :-) >> >> >> As I'm the main person who has been actively developing this, I'm your >> guy to ask questions :). >> >> By the way, this development has been my initiative the whole time, >> and not an official >> TI objective, so, to be honest, asking TI for official support won't >> help much right now. > > > Tell me how I can help make this happen. I'll be glad to apply patches, > figure out bu
Re: OMAP4 support
Hi Gary, On Tue, Jul 10, 2012 at 2:31 PM, Gary Thomas wrote: > On 2012-07-10 11:05, Chris Lalancette wrote: >> >> On Tue, Jul 10, 2012 at 9:41 AM, Gary Thomas wrote: >>> >>> I'm looking for video support on OMAP4 platforms. I've found the >>> PandaBoard camera project >>> (http://www.omappedia.org/wiki/PandaBoard_Camera_Support) >>> and this is starting to work. That said, I'm having some >>> issues with setting up the pipeline, etc. >>> >>> Can this list help out? >> >> >> I'm not sure exactly what kind of cameras you want to get working, but >> if you are looking to get CSI2 cameras going through the ISS, Sergio >> Aguirre has been working on support. He also works on the media-ctl >> tool, which is used for configuring the media framework pipeline. The >> latest versions that I am aware of are here: >> >> git://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera.git > > > Yes, this is the tree I've been working with (pointed to by the page I > mentioned). > > My kernel can see the camera OV5650 and set up the pipeline. I am able to > grab > the raw SGRBG10 data but I'd like to get the ISS to convert this to a more > usable > UYVY format. Here's what I tried: > media-ctl -r > media-ctl -l '"OMAP4 ISS CSI2a":1 -> "OMAP4 ISS ISP IPIPEIF":0 [1]' > media-ctl -l '"OMAP4 ISS ISP IPIPEIF":1 -> "OMAP4 ISS ISP IPIPEIF > output":0 [1]' > media-ctl -f '"ov5650 3-0036":0 [SGRBG10 2592x1944]' > media-ctl -f '"OMAP4 ISS CSI2a":0 [SGRBG10 2592x1944]' > media-ctl -f '"OMAP4 ISS ISP IPIPEIF":0 [SGRBG10 2592x1944]','"OMAP4 ISS > ISP IPIPEIF":1 [UYVY 2592x1944]' > > Sadly, I can't get the IPIPEIF element to take SGRGB10 in and put UYVY out > (my reading > of the manual implies that this _should_ be possible). I always see this > pipeline setup: > - entity 5: OMAP4 ISS ISP IPIPEIF (3 pads, 4 links) > type V4L2 subdev subtype Unknown > device node name /dev/v4l-subdev2 > pad0: Input [SGRBG10 2592x1944] > <- 'OMAP4 ISS CSI2a':pad1 [ACTIVE] > <- 'OMAP4 ISS CSI2b':pad1 [] > pad1: Output [SGRBG10 2592x1944] > -> 'OMAP4 ISS ISP IPIPEIF output':pad0 [ACTIVE] > pad2: Output [SGRBG10 2592x1944] > -> 'OMAP4 ISS ISP resizer':pad0 [] > > Am I missing something? How can I make this conversion in the ISS? The core problem is that, i haven't published any support for RAW10->YUV conversion, which is part of the IPIPE module (not the IPIPEIF, like you mention). I had some patches, but sadly it is unfinished work. :/ Now, there's a main non-technical problem... I no longer work at TI since end of June this year, and I don't have the right HW setup available anymore. Those sensors were company's asset, and I couldn't keep any. Now, we can make this work with cooperation of someone who has the right setup, and me sharing my patches and some advice on my experience. What do you think? > > Note: if this is not the appropriate place to ask these questions, please > redirect me (hopefully to a useful list :-) As I'm the main person who has been actively developing this, I'm your guy to ask questions :). By the way, this development has been my initiative the whole time, and not an official TI objective, so, to be honest, asking TI for official support won't help much right now. Regards, Sergio > > > Thanks > > -- > > Gary Thomas | Consulting for the > MLB Associates |Embedded world > > > -- 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: [Query] Clearing V4L2_BUF_FLAG_MAPPED flag on a videobuf2 buffer after munmap
On Fri, Jun 29, 2012 at 9:13 AM, Sergio Aguirre wrote: > Hi all, > > So, I've been trying to test the REQBUFS(0) from libv4l2 with my > omap4iss device, and I've hit the following problem: Actually... nevermind :( I just realized that multiple fixes went in after 3.1. This problem i had is on a Android ICS kernel, which is v3.0, and didn't had some REQBUFS(0) patches. Very sorry for the noise. Regards, Sergio > > So, I basically do the basic IOCTL sequence: > > open(/dev/video0) > VIDIOC_QUERYCAP > VIDIOC_ENUM_FMT > VIDIOC_ENUM_FRAMESIZES > VIDIOC_ENUM_FRAMEINTERVALS > VIDIOC_S_FMT (w = 640, h = 480, pixfmt = V4L2_PIX_FMT_YUYV, type = > V4L2_BUF_TYPE_VIDEO_CAPTURE) > VIDIOC_S_PARM (capability = V4L2_CAP_TIMEPERFRAME, timeperframe = 1/30) > VIDIOC_REQBUFS (count = 6, MMAP) > Loop for 6 times: > VIDIOC_QUERYBUF (to get buff length) > mmap(length) > Loop for 6 times: > VIDIOC_QBUF(index = 0-5) > VIDIOC_STREAMON > (Loop to poll, DQBUF and QBUF the same buffer) > VIDIOC_STREAMOFF > Loop for 6 times: > munmap() > VIDIOC_REQBUFS (count = 0, MMAP) > > ... And in this call, it fails on libv4l2 level, since it checks all > buffers to see > if they're mapped, by doign QUERYBUF on each index, and checking for > "V4L2_BUF_FLAG_MAPPED" flag. > > Now, digging deep into how this flag is populated, I noticed the following: > > I notice that in "drivers/media/video/videobuf2-core.c", inside: > vb2_querybuf() > -> __fill_v4l2_buffer() > > There's this condition: > if (vb->num_planes_mapped == vb->num_planes) > b->flags |= V4L2_BUF_FLAG_MAPPED; > > The problem is that, even if i did a munmap, the count of > vb->num_planes_mapped > is not decreased... :/ > > How's this supposed to work? Do I need to do something in my driver to avoid > this flag to be set? > > Regards, > Sergio -- 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
[Query] Clearing V4L2_BUF_FLAG_MAPPED flag on a videobuf2 buffer after munmap
Hi all, So, I've been trying to test the REQBUFS(0) from libv4l2 with my omap4iss device, and I've hit the following problem: So, I basically do the basic IOCTL sequence: open(/dev/video0) VIDIOC_QUERYCAP VIDIOC_ENUM_FMT VIDIOC_ENUM_FRAMESIZES VIDIOC_ENUM_FRAMEINTERVALS VIDIOC_S_FMT (w = 640, h = 480, pixfmt = V4L2_PIX_FMT_YUYV, type = V4L2_BUF_TYPE_VIDEO_CAPTURE) VIDIOC_S_PARM (capability = V4L2_CAP_TIMEPERFRAME, timeperframe = 1/30) VIDIOC_REQBUFS (count = 6, MMAP) Loop for 6 times: VIDIOC_QUERYBUF (to get buff length) mmap(length) Loop for 6 times: VIDIOC_QBUF(index = 0-5) VIDIOC_STREAMON (Loop to poll, DQBUF and QBUF the same buffer) VIDIOC_STREAMOFF Loop for 6 times: munmap() VIDIOC_REQBUFS (count = 0, MMAP) ... And in this call, it fails on libv4l2 level, since it checks all buffers to see if they're mapped, by doign QUERYBUF on each index, and checking for "V4L2_BUF_FLAG_MAPPED" flag. Now, digging deep into how this flag is populated, I noticed the following: I notice that in "drivers/media/video/videobuf2-core.c", inside: vb2_querybuf() -> __fill_v4l2_buffer() There's this condition: if (vb->num_planes_mapped == vb->num_planes) b->flags |= V4L2_BUF_FLAG_MAPPED; The problem is that, even if i did a munmap, the count of vb->num_planes_mapped is not decreased... :/ How's this supposed to work? Do I need to do something in my driver to avoid this flag to be set? Regards, Sergio -- 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 08/10] arm: omap4panda: Add support for omap4iss camera
Hi Tony, On Tue, May 8, 2012 at 6:46 PM, Tony Lindgren wrote: > * Sergio Aguirre [120502 08:21]: >> This adds support for camera interface with the support for >> following sensors: >> >> - OV5640 >> - OV5650 > > It seems that at this point we should initialize new things like this > with DT only. We don't quite yet have the muxing in place, but I'd > rather not add yet another big platform_data file for something that > does not even need to be there for DT booted devices. Ok. I'll look at that. By the way, I've been very out of the loop on al DT related development.. Are these instructions valid for current master k.org branch? http://omappedia.org/wiki/Device_Tree#Booting_with_DT_blob Regards, Sergio > > Regards, > > Tony > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 07/10] arm: omap4430sdp: Add support for omap4iss camera
Hi Sakari, On Sun, May 13, 2012 at 7:24 PM, Sakari Ailus wrote: > Hi Sergio, > > On Thu, May 03, 2012 at 10:20:47PM -0500, Aguirre, Sergio wrote: >> Hi Sakari, >> >> On Thu, May 3, 2012 at 7:03 AM, Aguirre, Sergio wrote: >> > Hi Sakari, >> > >> > Thanks for reviewing. >> > >> > On Wed, May 2, 2012 at 2:47 PM, Sakari Ailus wrote: >> >> >> >> Hi Sergio, >> >> >> >> Thanks for the patches!! >> >> >> >> On Wed, May 02, 2012 at 10:15:46AM -0500, Sergio Aguirre wrote: >> >> ... >> >>> +static int sdp4430_ov_cam1_power(struct v4l2_subdev *subdev, int on) >> >>> +{ >> >>> + struct device *dev = subdev->v4l2_dev->dev; >> >>> + int ret; >> >>> + >> >>> + if (on) { >> >>> + if (!regulator_is_enabled(sdp4430_cam2pwr_reg)) { >> >>> + ret = regulator_enable(sdp4430_cam2pwr_reg); >> >>> + if (ret) { >> >>> + dev_err(dev, >> >>> + "Error in enabling sensor power >> >>> regulator 'cam2pwr'\n"); >> >>> + return ret; >> >>> + } >> >>> + >> >>> + msleep(50); >> >>> + } >> >>> + >> >>> + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 1); >> >>> + msleep(10); >> >>> + ret = clk_enable(sdp4430_cam1_aux_clk); /* Enable XCLK */ >> >>> + if (ret) { >> >>> + dev_err(dev, >> >>> + "Error in clk_enable() in %s(%d)\n", >> >>> + __func__, on); >> >>> + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 0); >> >>> + return ret; >> >>> + } >> >>> + msleep(10); >> >>> + } else { >> >>> + clk_disable(sdp4430_cam1_aux_clk); >> >>> + msleep(1); >> >>> + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 0); >> >>> + if (regulator_is_enabled(sdp4430_cam2pwr_reg)) { >> >>> + ret = regulator_disable(sdp4430_cam2pwr_reg); >> >>> + if (ret) { >> >>> + dev_err(dev, >> >>> + "Error in disabling sensor power >> >>> regulator 'cam2pwr'\n"); >> >>> + return ret; >> >>> + } >> >>> + } >> >>> + } >> >>> + >> >>> + return 0; >> >>> +} >> >> >> >> Isn't this something that should be part of the sensor driver? There's >> >> nothing in the above code that would be board specific, except the names >> >> of >> >> the clocks, regulators and GPIOs. The sensor driver could hold the names >> >> instead; this would be also compatible with the device tree. >> > >> > Agreed. I see what you mean... >> > >> > I'll take care of that. >> >> Can you please check out these patches? >> >> 1. >> http://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera/commit/cb6c10d58053180364461e6bc8d30d1ec87e6e22 > > Ideally we should really get rid of the board code callbacks. What do you > need to do there? Well, in a OMAP44xx Blaze: http://svtronics.com/products/27-blaze-mdp The CSI2-A interface has 2 possible sensor inputs: - Sony IMX060 12 MP - OmniVision OV5650 5MP Which are muxed with a High speed differential selector. (Analog devices part: ADG936, found here: http://www.analog.com/static/imported-files/data_sheets/ADG936_936R.pdf) And to make it more fun, you switch that with a GPIO in an Audio IC (TWL6040) ! Quite a mess, but leaves me with few options, so that's why I need that to be board specific, and that by providing these function that can be used to take care of such "creative" designs :P Have better ideas? > >> 2. >> http://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera/commit/6732e0db25c6647b34ef8f01c244a49a1fd6b45d > > Isn't reset voltage level (high or low) a property of t
Re: Advice on extending libv4l for media controller support
Hi Ivan, Great to hear from you! Long time :) On Thu, May 10, 2012 at 10:09 AM, Ivan T. Ivanov wrote: > > Hi Sergio, > > On Thu, 2012-05-10 at 08:54 -0500, Sergio Aguirre wrote: >> +Atsuo >> >> On Wed, May 9, 2012 at 7:08 PM, Sergio Aguirre >> wrote: >> > Hi Hans, >> > >> > I'm interested in using libv4l along with my omap4 camera project to >> > adapt it more easily >> > to Android CameraHAL, and other applications, to reduce complexity of >> > them mostly... >> > >> > So, but the difference is that, this is a media controller device I'm >> > trying to add support for, >> > in which I want to create some sort of plugin with specific media >> > controller configurations, >> > to avoid userspace to worry about component names and specific >> > usecases (use sensor resizer, or SoC ISP resizer, etc.). >> > >> > So, I just wanted to know your advice on some things before I start >> > hacking your library: >> > > > Probably following links can help you. They have been tested > with the OMAP3 ISP. Awesome! This is certainly very useful. I'll look into adding OMAP4 ISS support too. Thanks for sharing! Regards, Sergio > > Regards, > iivanov > > [1] http://www.spinics.net/lists/linux-media/msg31901.html > [2] > http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/32704 > > -- 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: Advice on extending libv4l for media controller support
+Atsuo On Wed, May 9, 2012 at 7:08 PM, Sergio Aguirre wrote: > Hi Hans, > > I'm interested in using libv4l along with my omap4 camera project to > adapt it more easily > to Android CameraHAL, and other applications, to reduce complexity of > them mostly... > > So, but the difference is that, this is a media controller device I'm > trying to add support for, > in which I want to create some sort of plugin with specific media > controller configurations, > to avoid userspace to worry about component names and specific > usecases (use sensor resizer, or SoC ISP resizer, etc.). > > So, I just wanted to know your advice on some things before I start > hacking your library: > > 1. Should it be the right thing to add a new subfolder under "lib/", > named like "libomap4iss-mediactl" or something like that ? > 2. Do you know if anyone is working on something similar for any other > Media Controller device ? > > Thanks in advance for your inputs. > > Regards, > Sergio -- 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
Advice on extending libv4l for media controller support
Hi Hans, I'm interested in using libv4l along with my omap4 camera project to adapt it more easily to Android CameraHAL, and other applications, to reduce complexity of them mostly... So, but the difference is that, this is a media controller device I'm trying to add support for, in which I want to create some sort of plugin with specific media controller configurations, to avoid userspace to worry about component names and specific usecases (use sensor resizer, or SoC ISP resizer, etc.). So, I just wanted to know your advice on some things before I start hacking your library: 1. Should it be the right thing to add a new subfolder under "lib/", named like "libomap4iss-mediactl" or something like that ? 2. Do you know if anyone is working on something similar for any other Media Controller device ? Thanks in advance for your inputs. Regards, Sergio -- 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 06/10] v4l: Add support for ov5650 sensor
Signed-off-by: Sergio Aguirre --- drivers/media/video/Kconfig |6 + drivers/media/video/Makefile |1 + drivers/media/video/ov5650.c | 733 ++ include/media/ov5650.h | 10 + 4 files changed, 750 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/ov5650.c create mode 100644 include/media/ov5650.h diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index cc76652..e4d1875 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -486,6 +486,12 @@ config VIDEO_OV5640 help This is a ov5640 camera driver +config VIDEO_OV5650 + tristate "OmniVision OV5650 sensor support" + depends on I2C && VIDEO_V4L2 + help + This is a ov5650 camera driver + config VIDEO_VS6624 tristate "ST VS6624 sensor support" depends on VIDEO_V4L2 && I2C diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index da40ab3..01945c1 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile @@ -69,6 +69,7 @@ obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o obj-$(CONFIG_VIDEO_OV7670) += ov7670.o obj-$(CONFIG_VIDEO_OV5640) += ov5640.o +obj-$(CONFIG_VIDEO_OV5650) += ov5650.o obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o diff --git a/drivers/media/video/ov5650.c b/drivers/media/video/ov5650.c new file mode 100644 index 000..33ab148 --- /dev/null +++ b/drivers/media/video/ov5650.c @@ -0,0 +1,733 @@ +/* + * OmniVision OV5650 sensor driver + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* OV5650 has only one fixed colorspace per pixelcode */ +struct ov5650_datafmt { + enum v4l2_mbus_pixelcodecode; + enum v4l2_colorspacecolorspace; +}; + +enum ov5650_size { + OV5650_SIZE_5MP, + OV5650_SIZE_LAST, +}; + +static const struct v4l2_frmsize_discrete ov5650_frmsizes[OV5650_SIZE_LAST] = { + { 2592, 1944 }, +}; + +/* Find a frame size in an array */ +static int ov5650_find_framesize(u32 width, u32 height) +{ + int i; + + for (i = 0; i < OV5650_SIZE_LAST; i++) { + if ((ov5650_frmsizes[i].width >= width) && + (ov5650_frmsizes[i].height >= height)) + break; + } + + /* If not found, select biggest */ + if (i >= OV5650_SIZE_LAST) + i = OV5650_SIZE_LAST - 1; + + return i; +} + +struct ov5650 { + struct v4l2_subdev subdev; + struct media_pad pad; + + struct v4l2_mbus_framefmt format; + + struct v4l2_ctrl_handler ctrl_handler; + + const struct ov5650_platform_data *pdata; + + struct v4l2_ctrl *pixel_rate; +}; + +static inline struct ov5650 *to_ov5650(struct v4l2_subdev *sd) +{ + return container_of(sd, struct ov5650, subdev); +} + +/** + * struct ov5650_reg - ov5650 register format + * @reg: 16-bit offset to register + * @val: 8/16/32-bit register value + * @length: length of the register + * + * Define a structure for OV5650 register initialization values + */ +struct ov5650_reg { + u16 reg; + u8 val; +}; + +static const struct ov5650_reg configscript_common1[] = { + { 0x3103, 0x93 }, + { 0x3b07, 0x0c }, + { 0x3017, 0xff }, + { 0x3018, 0xfc }, + { 0x3706, 0x41 }, + { 0x3703, 0xe6 }, + { 0x3613, 0x44 }, + { 0x3630, 0x22 }, + { 0x3605, 0x04 }, + { 0x3606, 0x3f }, + { 0x3712, 0x13 }, + { 0x370e, 0x00 }, + { 0x370b, 0x40 }, + { 0x3600, 0x54 }, + { 0x3601, 0x05 }, + { 0x3713, 0x22 }, + { 0x3714, 0x27 }, + { 0x3631, 0x22 }, + { 0x3612, 0x1a }, + { 0x3604, 0x40 }, + { 0x3705, 0xda }, + { 0x370a, 0x80 }, + { 0x370c, 0x00 }, + { 0x3710, 0x28 }, + { 0x3702, 0x3a }, + { 0x3704, 0x18 }, + { 0x3a18, 0x00 }, + { 0x3a19, 0xf8 }, + { 0x3a00, 0x38 }, +}; + +static const struct ov5650_reg configscript_common2[] = { + { 0x3a08, 0x12 }, + { 0x3a09, 0x70 }, + { 0x3a0a, 0x0f }, + { 0x3a0b, 0x60 }, + { 0x3a0d, 0x06 }, + { 0x3a0e, 0x06 }, +
[PATCH v3 10/10] arm: Add support for CMA for omap4iss driver
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2b8cf73..5259691 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -18,6 +18,9 @@ #include #include #include +#ifdef CONFIG_CMA +#include +#endif #include @@ -265,6 +268,11 @@ int omap4_init_camera(struct iss_platform_data *pdata, struct omap_board_data *b oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); +#ifdef CONFIG_CMA + /* Create private 32MiB contiguous memory area for omap4iss device */ + dma_declare_contiguous(&pdev->dev, 32*SZ_1M, 0, 0); +#endif + return 0; } -- 1.7.5.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 v3 09/10] omap2plus: Add support for omap4iss camera
Also add support for following sensors: - OV5640 - OV5650 Signed-off-by: Sergio Aguirre --- arch/arm/configs/omap2plus_defconfig |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index d5f00d7..ea7e8e9 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig @@ -23,6 +23,8 @@ CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_ARCH_OMAP=y CONFIG_OMAP_RESET_CLOCKS=y CONFIG_OMAP_MUX_DEBUG=y +CONFIG_MACH_OMAP_4430SDP_CAMERA_SUPPORT=y +CONFIG_MACH_OMAP4_PANDA_CAMERA_SUPPORT=y CONFIG_ARM_THUMBEE=y CONFIG_ARM_ERRATA_411920=y CONFIG_NO_HZ=y -- 1.7.5.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 v3 08/10] arm: omap4panda: Add support for omap4iss camera
This adds support for camera interface with the support for following sensors: - OV5640 - OV5650 Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/Kconfig | 16 ++ arch/arm/mach-omap2/Makefile |1 + arch/arm/mach-omap2/board-omap4panda-camera.c | 209 + 3 files changed, 226 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-omap4panda-camera.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 54645aa..4b267a6 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -359,6 +359,22 @@ config MACH_OMAP4_PANDA select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE if REGULATOR +config MACH_OMAP4_PANDA_CAMERA_SUPPORT + bool "OMAP4 Panda Board Camera support" + depends on MACH_OMAP4_PANDA + select MEDIA_SUPPORT + select MEDIA_CONTROLLER + select VIDEO_DEV + select VIDEO_V4L2_SUBDEV_API + select V4L_PLATFORM_DRIVERS + select VIDEO_OMAP4 + select VIDEO_OV5640 + select VIDEO_OV5650 + help + Enable Camera HW support for PandaBoard. + This is for using the OMAP4 ISS CSI2A Camera sensor + interface. + config OMAP3_EMU bool "OMAP3 debugging peripherals" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index ebd8f63..e6724c4 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -240,6 +240,7 @@ obj-$(CONFIG_MACH_TI8148EVM)+= board-ti8168evm.o # Platform specific device init code obj-$(CONFIG_MACH_OMAP_4430SDP_CAMERA_SUPPORT) += board-4430sdp-camera.o +obj-$(CONFIG_MACH_OMAP4_PANDA_CAMERA_SUPPORT) += board-omap4panda-camera.o omap-flash-$(CONFIG_MTD_NAND_OMAP2):= board-flash.o omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o diff --git a/arch/arm/mach-omap2/board-omap4panda-camera.c b/arch/arm/mach-omap2/board-omap4panda-camera.c new file mode 100644 index 000..a5f7863 --- /dev/null +++ b/arch/arm/mach-omap2/board-omap4panda-camera.c @@ -0,0 +1,209 @@ +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "devices.h" +#include "../../../drivers/media/video/omap4iss/iss.h" + +#include "control.h" +#include "mux.h" + +#define PANDA_GPIO_CAM_PWRDN 45 +#define PANDA_GPIO_CAM_RESET 83 + +static struct clk *panda_cam_aux_clk; + +static int panda_ov_power(struct v4l2_subdev *subdev, int on) +{ + struct device *dev = subdev->v4l2_dev->dev; + + if (on) { + int ret; + + gpio_set_value(PANDA_GPIO_CAM_PWRDN, 0); + ret = clk_enable(panda_cam_aux_clk); + if (ret) { + dev_err(dev, + "Error in clk_enable() in %s(%d)\n", + __func__, on); + gpio_set_value(PANDA_GPIO_CAM_PWRDN, 1); + return ret; + } + mdelay(2); + } else { + clk_disable(panda_cam_aux_clk); + gpio_set_value(PANDA_GPIO_CAM_PWRDN, 1); + } + + return 0; +} + +#define OV5640_I2C_ADDRESS (0x3C) + +static struct ov5640_platform_data ov5640_platform_data = { + .s_power = panda_ov_power, +}; + +static struct i2c_board_info ov5640_camera_i2c_device = { + I2C_BOARD_INFO("ov5640", OV5640_I2C_ADDRESS), + .platform_data = &ov5640_platform_data, +}; + +#define OV5650_I2C_ADDRESS (0x36) + +static struct ov5650_platform_data ov5650_platform_data = { + .s_power = panda_ov_power, +}; + +static struct i2c_board_info ov5650_camera_i2c_device = { + I2C_BOARD_INFO("ov5650", OV5650_I2C_ADDRESS), + .platform_data = &ov5650_platform_data, +}; + +static struct iss_subdev_i2c_board_info ov5640_camera_subdevs[] = { + { + .board_info = &ov5640_camera_i2c_device, + .i2c_adapter_id = 3, + }, + { NULL, 0, }, +}; + +static struct iss_subdev_i2c_board_info ov5650_camera_subdevs[] = { + { + .board_info = &ov5650_camera_i2c_device, + .i2c_adapter_id = 3, + }, + { NULL, 0, }, +}; + +static struct iss_v4l2_subdevs_group panda_camera_subdevs[] = { + { + .subdevs = ov5640_camera_subdevs, + .interface = ISS_INTERFACE_CSI2A_PHY1, + .bus = { .csi2 = { + .lanecfg= { + .clk = { + .pol = 0, + .pos = 1, + }, +
[PATCH v3 05/10] v4l: Add support for ov5640 sensor
This adds a very limited driver for ov5640, which only supports: - 2592x1944 @ ~7.5 fps - 1920x1080 @ ~15 fps, - 1280x720 @ ~24 fps, - 640x480 @ ~24 fps, - 320x240 @ ~24 fps, All in YUV422i format, using 1 CSI2 datalane @ 333 MHz. Signed-off-by: Sergio Aguirre --- drivers/media/video/Kconfig |6 + drivers/media/video/Makefile |1 + drivers/media/video/ov5640.c | 948 ++ include/media/ov5640.h | 10 + 4 files changed, 965 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/ov5640.c create mode 100644 include/media/ov5640.h diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 4482ac4..cc76652 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -480,6 +480,12 @@ config VIDEO_OV7670 OV7670 VGA camera. It currently only works with the M88ALP01 controller. +config VIDEO_OV5640 + tristate "OmniVision OV5640 sensor support" + depends on I2C && VIDEO_V4L2 + help + This is a ov5640 camera driver + config VIDEO_VS6624 tristate "ST VS6624 sensor support" depends on VIDEO_V4L2 && I2C diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index c95cc0d..da40ab3 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile @@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_CX25840) += cx25840/ obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o obj-$(CONFIG_VIDEO_OV7670) += ov7670.o +obj-$(CONFIG_VIDEO_OV5640) += ov5640.o obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o diff --git a/drivers/media/video/ov5640.c b/drivers/media/video/ov5640.c new file mode 100644 index 000..2a64d50 --- /dev/null +++ b/drivers/media/video/ov5640.c @@ -0,0 +1,948 @@ +/* + * OmniVision OV5640 sensor driver + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* OV5640 has only one fixed colorspace per pixelcode */ +struct ov5640_datafmt { + enum v4l2_mbus_pixelcodecode; + enum v4l2_colorspacecolorspace; +}; + +struct ov5640_timing_cfg { + u16 x_addr_start; + u16 y_addr_start; + u16 x_addr_end; + u16 y_addr_end; + u16 h_output_size; + u16 v_output_size; + u16 h_total_size; + u16 v_total_size; + u16 isp_h_offset; + u16 isp_v_offset; + u8 h_odd_ss_inc; + u8 h_even_ss_inc; + u8 v_odd_ss_inc; + u8 v_even_ss_inc; +}; + +enum ov5640_size { + OV5640_SIZE_QVGA, + OV5640_SIZE_VGA, + OV5640_SIZE_720P, + OV5640_SIZE_1080P, + OV5640_SIZE_5MP, + OV5640_SIZE_LAST, +}; + +static const struct v4l2_frmsize_discrete ov5640_frmsizes[OV5640_SIZE_LAST] = { + { 320, 240 }, + { 640, 480 }, + { 1280, 720 }, + { 1920, 1080 }, + { 2592, 1944 }, +}; + +/* Find a frame size in an array */ +static int ov5640_find_framesize(u32 width, u32 height) +{ + int i; + + for (i = 0; i < OV5640_SIZE_LAST; i++) { + if ((ov5640_frmsizes[i].width >= width) && + (ov5640_frmsizes[i].height >= height)) + break; + } + + /* If not found, select biggest */ + if (i >= OV5640_SIZE_LAST) + i = OV5640_SIZE_LAST - 1; + + return i; +} + +struct ov5640 { + struct v4l2_subdev subdev; + struct media_pad pad; + struct v4l2_mbus_framefmt format; + + struct v4l2_ctrl_handler ctrl_handler; + + const struct ov5640_platform_data *pdata; + + struct v4l2_ctrl *pixel_rate; +}; + +static inline struct ov5640 *to_ov5640(struct v4l2_subdev *sd) +{ + return container_of(sd, struct ov5640, subdev); +} + +/** + * struct ov5640_reg - ov5640 register format + * @reg: 16-bit offset to register + * @val: 8/16/32-bit register value + * @length: length of the register + * + * Define a structure for OV5640 register initialization values + */ +struct ov5640_reg { + u16 reg; + u8 val; +}; + +/* TODO: Divide this properly */ +static const struct ov5640_reg configscript_common1[] = { + { 0x3103, 0x03 }, + { 0x3017, 0x00 }, + { 0x3018, 0x00 }, +
[PATCH v3 07/10] arm: omap4430sdp: Add support for omap4iss camera
This adds support for camera interface with the support for following sensors: - OV5640 - OV5650 Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/Kconfig| 16 + arch/arm/mach-omap2/Makefile |2 + arch/arm/mach-omap2/board-4430sdp-camera.c | 415 arch/arm/mach-omap2/board-4430sdp.c| 20 ++ 4 files changed, 453 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-4430sdp-camera.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 8141b76..54645aa 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -335,6 +335,22 @@ config MACH_OMAP_4430SDP select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE if REGULATOR +config MACH_OMAP_4430SDP_CAMERA_SUPPORT + bool "OMAP 4430 SDP board Camera support" + depends on MACH_OMAP_4430SDP + select MEDIA_SUPPORT + select MEDIA_CONTROLLER + select VIDEO_DEV + select VIDEO_V4L2_SUBDEV_API + select V4L_PLATFORM_DRIVERS + select VIDEO_OMAP4 + select VIDEO_OV5640 + select VIDEO_OV5650 + help + Enable Camera HW support for OMAP 4430 SDP board + This is for using the OMAP4 ISS CSI2A Camera sensor + interface. + config MACH_OMAP4_PANDA bool "OMAP4 Panda Board" default y diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 49f92bc..ebd8f63 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -239,6 +239,8 @@ obj-$(CONFIG_MACH_TI8148EVM)+= board-ti8168evm.o # Platform specific device init code +obj-$(CONFIG_MACH_OMAP_4430SDP_CAMERA_SUPPORT) += board-4430sdp-camera.o + omap-flash-$(CONFIG_MTD_NAND_OMAP2):= board-flash.o omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o obj-y += $(omap-flash-y) $(omap-flash-m) diff --git a/arch/arm/mach-omap2/board-4430sdp-camera.c b/arch/arm/mach-omap2/board-4430sdp-camera.c new file mode 100644 index 000..9a8881f --- /dev/null +++ b/arch/arm/mach-omap2/board-4430sdp-camera.c @@ -0,0 +1,415 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "devices.h" +#include "../../../drivers/media/video/omap4iss/iss.h" + +#include "control.h" +#include "mux.h" + +#define OMAP4430SDP_GPIO_CAM_PDN_B 38 +#define OMAP4430SDP_GPIO_CAM_PDN_C 39 + +static struct clk *sdp4430_cam1_aux_clk; +static struct clk *sdp4430_cam2_aux_clk; +static struct regulator *sdp4430_cam2pwr_reg; + +static int sdp4430_ov_cam1_power(struct v4l2_subdev *subdev, int on) +{ + struct device *dev = subdev->v4l2_dev->dev; + int ret; + + if (on) { + if (!regulator_is_enabled(sdp4430_cam2pwr_reg)) { + ret = regulator_enable(sdp4430_cam2pwr_reg); + if (ret) { + dev_err(dev, + "Error in enabling sensor power regulator 'cam2pwr'\n"); + return ret; + } + + msleep(50); + } + + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 1); + msleep(10); + ret = clk_enable(sdp4430_cam1_aux_clk); /* Enable XCLK */ + if (ret) { + dev_err(dev, + "Error in clk_enable() in %s(%d)\n", + __func__, on); + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 0); + return ret; + } + msleep(10); + } else { + clk_disable(sdp4430_cam1_aux_clk); + msleep(1); + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_B, 0); + if (regulator_is_enabled(sdp4430_cam2pwr_reg)) { + ret = regulator_disable(sdp4430_cam2pwr_reg); + if (ret) { + dev_err(dev, + "Error in disabling sensor power regulator 'cam2pwr'\n"); + return ret; + } + } + } + + return 0; +} + +static int sdp4430_ov_cam2_power(struct v4l2_subdev *subdev, int on) +{ + struct device *dev = subdev->v4l2_dev->dev; + int ret; + + if (on) { + u8 gpoctl = 0; + + ret = regulator_enable(sdp4430_cam2pwr_reg); + if (ret) { + dev_err(dev, + "Error in enabling sensor power regulator 'cam2pwr'\n"); + return ret; + } + +
[PATCH v3 02/10] OMAP4: hwmod: Include CSI2A/B and CSIPHY1/2 memory sections
In memory, They are in this particular order: - CSI2A - CSIPHY1 - CSI2B - CSIPHY2 Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 22 +- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 6abc757..a7b2380 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -2641,6 +2641,26 @@ static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = { .pa_end = 0x52ff, .flags = ADDR_TYPE_RT }, + { + .pa_start = 0x52001000, + .pa_end = 0x5200116f, + .flags = ADDR_TYPE_RT + }, + { + .pa_start = 0x52001170, + .pa_end = 0x5200118f, + .flags = ADDR_TYPE_RT + }, + { + .pa_start = 0x52001400, + .pa_end = 0x5200156f, + .flags = ADDR_TYPE_RT + }, + { + .pa_start = 0x52001570, + .pa_end = 0x5200158f, + .flags = ADDR_TYPE_RT + }, { } }; @@ -5605,7 +5625,7 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { &omap44xx_ipu_c1_hwmod, /* iss class */ -/* &omap44xx_iss_hwmod, */ + &omap44xx_iss_hwmod, /* iva class */ &omap44xx_iva_hwmod, -- 1.7.5.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 v3 03/10] OMAP4: Add base addresses for ISS
NOTE: This isn't the whole list of features that the ISS supports, but the only ones supported at the moment. Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index e433603..2b8cf73 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include @@ -236,6 +238,36 @@ int omap3_init_camera(struct isp_platform_data *pdata) #endif +int omap4_init_camera(struct iss_platform_data *pdata, struct omap_board_data *bdata) +{ + struct platform_device *pdev; + struct omap_hwmod *oh; + struct iss_platform_data *omap4iss_pdata; + const char *oh_name = "iss"; + const char *name = "omap4iss"; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not look up %s\n", oh_name); + return -ENODEV; + } + + omap4iss_pdata = pdata; + + pdev = omap_device_build(name, -1, oh, omap4iss_pdata, + sizeof(struct iss_platform_data), NULL, 0, 0); + + if (IS_ERR(pdev)) { + WARN(1, "Can't build omap_device for %s:%s.\n", + name, oh->name); + return PTR_ERR(pdev); + } + + oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); + + return 0; +} + static inline void omap_init_camera(void) { #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -- 1.7.5.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 v3 01/10] mfd: twl6040: Fix wrong TWL6040_GPO3 bitfield value
The define should be the result of 1 << Bit number. Bit number for GPOCTL.GPO3 field is 2, which results in 0x4 value. Signed-off-by: Sergio Aguirre --- include/linux/mfd/twl6040.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index b15b5f0..df86c14 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h @@ -142,7 +142,7 @@ #define TWL6040_GPO1 0x01 #define TWL6040_GPO2 0x02 -#define TWL6040_GPO3 0x03 +#define TWL6040_GPO3 0x04 /* ACCCTL (0x2D) fields */ -- 1.7.5.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 v3 00/10] v4l2: OMAP4 ISS driver + Sensor + Board support
Hi everyone, It's been a long time since last version (5 months)! :) This is the third version of the OMAP4 ISS driver, which uses Media Controller and videobuf2 frameworks. This patchset should apply cleanly on top of v3.4-rc5 kernel tag. This driver attempts to provide an fully open source solution to control the OMAP4 Imaging SubSystem (a.k.a. ISS). Starts with just CSI2-A/B interface support, and pretends to be ready for expansion to add support to the many ISS block modules as possible. Please see newly added documentation for more details: Documentation/video4linux/omap4_camera.txt Any comments/complaints are welcome. :) Changes since v2: - Supports CSI2B now! - Add support for RAW8. - Usage of V4L2_CID_PIXEL_RATE, instead of dphy configuration in boardfile (similar to omap3isp) - Removes save/restore support for now, as it is broken. - Attend several comments form Sakari Ailus (Thanks Sakari!) - Populate hw_revision in media_dev struct. - Ported several fixes pushed for omap3isp (Thanks Laurent!) - Use module_platform_driver. - Use proposed generic v4l2_subdev_link_validate. - Move OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX handle to omap4iss code, instead of board file. Changes since v1: - Simplification of auxclk handlign in board files - Use of HWMOD declaration for assisted platform_device creation. - Videobuf2 migration (Removal of custom iss_queue buffer handling driver) Regards, Sergio Sergio Aguirre (10): mfd: twl6040: Fix wrong TWL6040_GPO3 bitfield value OMAP4: hwmod: Include CSI2A/B and CSIPHY1/2 memory sections OMAP4: Add base addresses for ISS v4l: Add support for omap4iss driver v4l: Add support for ov5640 sensor v4l: Add support for ov5650 sensor arm: omap4430sdp: Add support for omap4iss camera arm: omap4panda: Add support for omap4iss camera omap2plus: Add support for omap4iss camera arm: Add support for CMA for omap4iss driver Documentation/video4linux/omap4_camera.txt| 64 ++ arch/arm/configs/omap2plus_defconfig |2 + arch/arm/mach-omap2/Kconfig | 32 + arch/arm/mach-omap2/Makefile |3 + arch/arm/mach-omap2/board-4430sdp-camera.c| 415 arch/arm/mach-omap2/board-4430sdp.c | 20 + arch/arm/mach-omap2/board-omap4panda-camera.c | 209 arch/arm/mach-omap2/devices.c | 40 + arch/arm/mach-omap2/devices.h |4 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c| 22 +- drivers/media/video/Kconfig | 25 + drivers/media/video/Makefile |3 + drivers/media/video/omap4iss/Makefile |6 + drivers/media/video/omap4iss/iss.c| 1159 + drivers/media/video/omap4iss/iss.h| 121 +++ drivers/media/video/omap4iss/iss_csi2.c | 1368 + drivers/media/video/omap4iss/iss_csi2.h | 155 +++ drivers/media/video/omap4iss/iss_csiphy.c | 281 + drivers/media/video/omap4iss/iss_csiphy.h | 51 + drivers/media/video/omap4iss/iss_regs.h | 244 + drivers/media/video/omap4iss/iss_video.c | 1123 drivers/media/video/omap4iss/iss_video.h | 201 drivers/media/video/ov5640.c | 948 + drivers/media/video/ov5650.c | 733 + include/linux/mfd/twl6040.h |2 +- include/media/omap4iss.h | 65 ++ include/media/ov5640.h| 10 + include/media/ov5650.h| 10 + 28 files changed, 7314 insertions(+), 2 deletions(-) create mode 100644 Documentation/video4linux/omap4_camera.txt create mode 100644 arch/arm/mach-omap2/board-4430sdp-camera.c create mode 100644 arch/arm/mach-omap2/board-omap4panda-camera.c create mode 100644 drivers/media/video/omap4iss/Makefile create mode 100644 drivers/media/video/omap4iss/iss.c create mode 100644 drivers/media/video/omap4iss/iss.h create mode 100644 drivers/media/video/omap4iss/iss_csi2.c create mode 100644 drivers/media/video/omap4iss/iss_csi2.h create mode 100644 drivers/media/video/omap4iss/iss_csiphy.c create mode 100644 drivers/media/video/omap4iss/iss_csiphy.h create mode 100644 drivers/media/video/omap4iss/iss_regs.h create mode 100644 drivers/media/video/omap4iss/iss_video.c create mode 100644 drivers/media/video/omap4iss/iss_video.h create mode 100644 drivers/media/video/ov5640.c create mode 100644 drivers/media/video/ov5650.c create mode 100644 include/media/omap4iss.h create mode 100644 include/media/ov5640.h create mode 100644 include/media/ov5650.h -- 1.7.5.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
[media-ctl PATCH] Compare entity name length aswell
Otherwise, some false positives might arise when having 2 subdevices with similar names, like: "OMAP4 ISS ISP IPIPEIF" "OMAP4 ISS ISP IPIPE" Before this patch, trying to find "OMAP4 ISS ISP IPIPE", resulted in a false entity match, retrieving "OMAP4 ISS ISP IPIPEIF" information instead. Checking length should ensure such cases are handled well. Signed-off-by: Sergio Aguirre --- src/mediactl.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/mediactl.c b/src/mediactl.c index 5b8c587..451a386 100644 --- a/src/mediactl.c +++ b/src/mediactl.c @@ -66,7 +66,8 @@ struct media_entity *media_get_entity_by_name(struct media_device *media, for (i = 0; i < media->entities_count; ++i) { struct media_entity *entity = &media->entities[i]; - if (strncmp(entity->info.name, name, length) == 0) + if ((strncmp(entity->info.name, name, length) == 0) && + (strlen(entity->info.name) == length)) return entity; } -- 1.7.5.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 04/11] OMAP4: hwmod: Include CSI2A and CSIPHY1 memory sections
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 7695e5d..1b59e2f 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -2623,8 +2623,18 @@ static struct omap_hwmod_ocp_if *omap44xx_iss_masters[] = { static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = { { - .pa_start = 0x5200, - .pa_end = 0x52ff, + .pa_start = OMAP44XX_ISS_TOP_BASE, + .pa_end = OMAP44XX_ISS_TOP_END, + .flags = ADDR_TYPE_RT + }, + { + .pa_start = OMAP44XX_ISS_CSI2_A_REGS1_BASE, + .pa_end = OMAP44XX_ISS_CSI2_A_REGS1_END, + .flags = ADDR_TYPE_RT + }, + { + .pa_start = OMAP44XX_ISS_CAMERARX_CORE1_BASE, + .pa_end = OMAP44XX_ISS_CAMERARX_CORE1_END, .flags = ADDR_TYPE_RT }, { } @@ -5350,7 +5360,7 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { &omap44xx_ipu_c1_hwmod, /* iss class */ -/* &omap44xx_iss_hwmod, */ + &omap44xx_iss_hwmod, /* iva class */ &omap44xx_iva_hwmod, -- 1.7.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 07/11] v4l: Add support for ov5640 sensor
This adds a very limited driver for ov5640, which only supports: - 2592x1944 @ ~7.5 fps - 1920x1080 @ ~15 fps, - 1280x720 @ ~24 fps, - 640x480 @ ~24 fps, - 320x240 @ ~24 fps, All in YUV422i format, using 1 CSI2 datalane @ 333 MHz. Signed-off-by: Sergio Aguirre --- drivers/media/video/Kconfig |6 + drivers/media/video/Makefile|1 + drivers/media/video/ov5640.c| 972 +++ include/media/ov5640.h | 10 + include/media/v4l2-chip-ident.h |1 + 5 files changed, 990 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/ov5640.c create mode 100644 include/media/ov5640.h diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ae2a99d..3ee4fc9 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -467,6 +467,12 @@ config VIDEO_OV7670 OV7670 VGA camera. It currently only works with the M88ALP01 controller. +config VIDEO_OV5640 + tristate "OmniVision OV5640 sensor support" + depends on I2C && VIDEO_V4L2 + help + This is a ov5640 camera driver + config VIDEO_MT9P031 tristate "Aptina MT9P031 support" depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index f02a4c4..d296c7b 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile @@ -63,6 +63,7 @@ obj-$(CONFIG_VIDEO_CX25840) += cx25840/ obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o obj-$(CONFIG_VIDEO_OV7670) += ov7670.o +obj-$(CONFIG_VIDEO_OV5640) += ov5640.o obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o diff --git a/drivers/media/video/ov5640.c b/drivers/media/video/ov5640.c new file mode 100644 index 000..c93802a --- /dev/null +++ b/drivers/media/video/ov5640.c @@ -0,0 +1,972 @@ +/* + * OmniVision OV5640 sensor driver + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define OV5640_BRIGHTNESS_MIN 0 +#define OV5640_BRIGHTNESS_MAX 200 +#define OV5640_BRIGHTNESS_STEP 100 +#define OV5640_BRIGHTNESS_DEF 100 + +#define OV5640_CONTRAST_MIN0 +#define OV5640_CONTRAST_MAX200 +#define OV5640_CONTRAST_STEP 100 +#define OV5640_CONTRAST_DEF100 + +/* OV5640 has only one fixed colorspace per pixelcode */ +struct ov5640_datafmt { + enum v4l2_mbus_pixelcodecode; + enum v4l2_colorspacecolorspace; +}; + +struct ov5640_timing_cfg { + u16 x_addr_start; + u16 y_addr_start; + u16 x_addr_end; + u16 y_addr_end; + u16 h_output_size; + u16 v_output_size; + u16 h_total_size; + u16 v_total_size; + u16 isp_h_offset; + u16 isp_v_offset; + u8 h_odd_ss_inc; + u8 h_even_ss_inc; + u8 v_odd_ss_inc; + u8 v_even_ss_inc; +}; + +enum ov5640_size { + OV5640_SIZE_QVGA, + OV5640_SIZE_VGA, + OV5640_SIZE_720P, + OV5640_SIZE_1080P, + OV5640_SIZE_5MP, + OV5640_SIZE_LAST, +}; + +static const struct v4l2_frmsize_discrete ov5640_frmsizes[OV5640_SIZE_LAST] = { + { 320, 240 }, + { 640, 480 }, + { 1280, 720 }, + { 1920, 1080 }, + { 2592, 1944 }, +}; + +/* Find a frame size in an array */ +static int ov5640_find_framesize(u32 width, u32 height) +{ + int i; + + for (i = 0; i < OV5640_SIZE_LAST; i++) { + if ((ov5640_frmsizes[i].width >= width) && + (ov5640_frmsizes[i].height >= height)) + break; + } + + /* If not found, select biggest */ + if (i >= OV5640_SIZE_LAST) + i = OV5640_SIZE_LAST - 1; + + return i; +} + +struct ov5640 { + struct v4l2_subdev subdev; + struct media_pad pad; + struct v4l2_mbus_framefmt format; + const struct ov5640_platform_data *pdata; + int brightness; + int contrast; + int colorlevel; +}; + +static inline struct ov5640 *to_ov5640(struct v4l2_subdev *sd) +{ + retur
[PATCH v2 00/11] v4l2: OMAP4 ISS driver + Sensor + Board support
Hi everyone, This is the second version of the OMAP4 ISS driver, now ported to the Media Controller framework AND supporting videobuf2 framework. This patchset should apply cleanly on top of v3.2-rc3 kernel tag. This driver attempts to provide an fully open source solution to control the OMAP4 Imaging SubSystem (a.k.a. ISS). Starts with just CSI2-A interface support, and pretends to be ready for expansion to add support to the many ISS block modules as possible. Please see newly added documentation for more details: Documentation/video4linux/omap4_camera.txt Any comments/complaints are welcome. :) Changes since v1: - Simplification of auxclk handling in board files. (Pointed out by: Roger Quadros) - Cleanup of Camera support enablement for 4430sdp & panda. (Pointed out by: Roger Quadros) - Use of HWMOD declaration for assisted platform_device creation. (Pointed out by: Felipe Balbi) - Videobuf2 migration (Removal of custom iss_queue buffer handling driver) - Proper GPO3 handling for CAM_SEL in 4430sdp. Sergio Aguirre (10): TWL6030: Add mapping for auxiliary regs mfd: twl6040: Fix wrong TWL6040_GPO3 bitfield value OMAP4: hwmod: Include CSI2A and CSIPHY1 memory sections OMAP4: Add base addresses for ISS v4l: Add support for omap4iss driver v4l: Add support for ov5640 sensor v4l: Add support for ov5650 sensor arm: omap4430sdp: Add support for omap4iss camera arm: omap4panda: Add support for omap4iss camera arm: Add support for CMA for omap4iss driver Stanimir Varbanov (1): v4l: Introduce sensor operation for getting interface configuration Documentation/video4linux/omap4_camera.txt| 60 ++ arch/arm/mach-omap2/Kconfig | 54 + arch/arm/mach-omap2/Makefile |3 + arch/arm/mach-omap2/board-4430sdp-camera.c| 221 arch/arm/mach-omap2/board-omap4panda-camera.c | 198 arch/arm/mach-omap2/devices.c | 40 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c| 16 +- arch/arm/plat-omap/include/plat/omap4-iss.h | 42 + arch/arm/plat-omap/include/plat/omap44xx.h|9 + drivers/media/video/Kconfig | 25 + drivers/media/video/Makefile |3 + drivers/media/video/omap4iss/Makefile |6 + drivers/media/video/omap4iss/iss.c| 1179 ++ drivers/media/video/omap4iss/iss.h| 133 +++ drivers/media/video/omap4iss/iss_csi2.c | 1324 + drivers/media/video/omap4iss/iss_csi2.h | 166 +++ drivers/media/video/omap4iss/iss_csiphy.c | 215 drivers/media/video/omap4iss/iss_csiphy.h | 69 ++ drivers/media/video/omap4iss/iss_regs.h | 238 + drivers/media/video/omap4iss/iss_video.c | 1192 ++ drivers/media/video/omap4iss/iss_video.h | 205 drivers/media/video/ov5640.c | 972 ++ drivers/media/video/ov5650.c | 524 ++ drivers/mfd/twl-core.c|2 +- include/linux/mfd/twl6040.h |2 +- include/media/ov5640.h| 10 + include/media/ov5650.h| 10 + include/media/v4l2-chip-ident.h |2 + include/media/v4l2-subdev.h | 42 + 29 files changed, 6957 insertions(+), 5 deletions(-) create mode 100644 Documentation/video4linux/omap4_camera.txt create mode 100644 arch/arm/mach-omap2/board-4430sdp-camera.c create mode 100644 arch/arm/mach-omap2/board-omap4panda-camera.c create mode 100644 arch/arm/plat-omap/include/plat/omap4-iss.h create mode 100644 drivers/media/video/omap4iss/Makefile create mode 100644 drivers/media/video/omap4iss/iss.c create mode 100644 drivers/media/video/omap4iss/iss.h create mode 100644 drivers/media/video/omap4iss/iss_csi2.c create mode 100644 drivers/media/video/omap4iss/iss_csi2.h create mode 100644 drivers/media/video/omap4iss/iss_csiphy.c create mode 100644 drivers/media/video/omap4iss/iss_csiphy.h create mode 100644 drivers/media/video/omap4iss/iss_regs.h create mode 100644 drivers/media/video/omap4iss/iss_video.c create mode 100644 drivers/media/video/omap4iss/iss_video.h create mode 100644 drivers/media/video/ov5640.c create mode 100644 drivers/media/video/ov5650.c create mode 100644 include/media/ov5640.h create mode 100644 include/media/ov5650.h -- 1.7.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 03/11] v4l: Introduce sensor operation for getting interface configuration
From: Stanimir Varbanov Introduce g_interface_parms sensor operation for getting sensor interface parameters. These parameters are needed from the host side to determine it's own configuration. Signed-off-by: Stanimir Varbanov --- include/media/v4l2-subdev.h | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index f0f3358..0d322ed 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -362,6 +362,42 @@ struct v4l2_subdev_vbi_ops { int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt); }; +/* Which interface the sensor use to provide it's image data */ +enum v4l2_subdev_sensor_iface { + V4L2_SUBDEV_SENSOR_PARALLEL, + V4L2_SUBDEV_SENSOR_SERIAL, +}; + +/* Each interface could use the following modes */ +/* Image sensor provides horizontal and vertical sync signals */ +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_SYNC 0 +/* BT.656 interface. Embedded sync */ +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_ITU 1 +/* MIPI CSI1 */ +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI12 +/* MIPI CSI2 */ +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI23 + +struct v4l2_subdev_sensor_serial_parms { + unsigned char lanes;/* number of lanes used */ + unsigned char channel; /* virtual channel */ + unsigned int phy_rate; /* output rate at CSI phy in bps */ + unsigned int pix_clk; /* pixel clock in Hz */ +}; + +struct v4l2_subdev_sensor_parallel_parms { + unsigned int pix_clk; /* pixel clock in Hz */ +}; + +struct v4l2_subdev_sensor_interface_parms { + enum v4l2_subdev_sensor_iface if_type; + unsigned int if_mode; + union { + struct v4l2_subdev_sensor_serial_parms serial; + struct v4l2_subdev_sensor_parallel_parms parallel; + } parms; +}; + /** * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations * @g_skip_top_lines: number of lines at the top of the image to be skipped. @@ -371,10 +407,16 @@ struct v4l2_subdev_vbi_ops { * @g_skip_frames: number of frames to skip at stream start. This is needed for *buggy sensors that generate faulty frames when they are *turned on. + * @g_interface_parms: get sensor interface parameters. The sensor subdev should + *fill this structure with current interface params. These + *interface parameters are needed on host side to configure + *it's own hardware receivers. */ struct v4l2_subdev_sensor_ops { int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines); int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames); + int (*g_interface_parms)(struct v4l2_subdev *sd, + struct v4l2_subdev_sensor_interface_parms *parms); }; /* -- 1.7.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 05/11] OMAP4: Add base addresses for ISS
NOTE: This isn't the whole list of features that the ISS supports, but the only ones supported at the moment. Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c | 32 arch/arm/plat-omap/include/plat/omap44xx.h |9 +++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c15cfad..b48aeea 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "mux.h" #include "control.h" @@ -217,6 +218,37 @@ int omap3_init_camera(struct isp_platform_data *pdata) return platform_device_register(&omap3isp_device); } +int omap4_init_camera(struct iss_platform_data *pdata, struct omap_board_data *bdata) +{ + struct platform_device *pdev; + struct omap_hwmod *oh; + struct iss_platform_data *omap4iss_pdata; + char *oh_name = "iss"; + char *name = "omap4iss"; + unsigned int id = -1; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not look up %s\n", oh_name); + return -ENODEV; + } + + omap4iss_pdata = pdata; + + pdev = omap_device_build(name, id, oh, omap4iss_pdata, + sizeof(struct iss_platform_data), NULL, 0, 0); + + if (IS_ERR(pdev)) { + WARN(1, "Can't build omap_device for %s:%s.\n", + name, oh->name); + return PTR_ERR(pdev); + } + + oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); + + return 0; +} + static inline void omap_init_camera(void) { #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h index ea2b8a6..31432aa 100644 --- a/arch/arm/plat-omap/include/plat/omap44xx.h +++ b/arch/arm/plat-omap/include/plat/omap44xx.h @@ -49,6 +49,15 @@ #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) #define OMAP44XX_HSUSB_OTG_BASE(L4_44XX_BASE + 0xAB000) +#define OMAP44XX_ISS_BASE 0x5200 +#define OMAP44XX_ISS_TOP_BASE (OMAP44XX_ISS_BASE + 0x0) +#define OMAP44XX_ISS_CSI2_A_REGS1_BASE (OMAP44XX_ISS_BASE + 0x1000) +#define OMAP44XX_ISS_CAMERARX_CORE1_BASE (OMAP44XX_ISS_BASE + 0x1170) + +#define OMAP44XX_ISS_TOP_END (OMAP44XX_ISS_TOP_BASE + 256 - 1) +#define OMAP44XX_ISS_CSI2_A_REGS1_END (OMAP44XX_ISS_CSI2_A_REGS1_BASE + 368 - 1) +#define OMAP44XX_ISS_CAMERARX_CORE1_END (OMAP44XX_ISS_CAMERARX_CORE1_BASE + 32 - 1) + #define OMAP4_MMU1_BASE0x55082000 #define OMAP4_MMU2_BASE0x4A066000 -- 1.7.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 09/11] arm: omap4430sdp: Add support for omap4iss camera
This adds support for camera interface with the support for following sensors: - OV5640 - OV5650 Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/Kconfig| 27 arch/arm/mach-omap2/Makefile |2 + arch/arm/mach-omap2/board-4430sdp-camera.c | 221 3 files changed, 250 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-4430sdp-camera.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 5034147..f883abb 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -323,6 +323,33 @@ config MACH_OMAP_4430SDP select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE +config MACH_OMAP_4430SDP_CAMERA_SUPPORT + bool "OMAP 4430 SDP board Camera support" + depends on MACH_OMAP_4430SDP + select MEDIA_SUPPORT + select MEDIA_CONTROLLER + select VIDEO_DEV + select VIDEO_V4L2_SUBDEV_API + select VIDEO_OMAP4 + help + Enable Camera HW support for OMAP 4430 SDP board + This is for using the OMAP4 ISS CSI2A Camera sensor + interface. + +choice + prompt "Camera sensor to use" + depends on MACH_OMAP_4430SDP_CAMERA_SUPPORT + default MACH_OMAP_4430SDP_CAM_OV5650 + + config MACH_OMAP_4430SDP_CAM_OV5640 + bool "Use OmniVision OV5640 Camera" + select VIDEO_OV5640 + + config MACH_OMAP_4430SDP_CAM_OV5650 + bool "Use OmniVision OV5650 Camera" + select VIDEO_OV5650 +endchoice + config MACH_OMAP4_PANDA bool "OMAP4 Panda Board" default y diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 69ab1c0..8bc446a 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -235,6 +235,8 @@ obj-$(CONFIG_MACH_TI8168EVM)+= board-ti8168evm.o # Platform specific device init code +obj-$(CONFIG_MACH_OMAP_4430SDP_CAMERA_SUPPORT) += board-4430sdp-camera.o + omap-flash-$(CONFIG_MTD_NAND_OMAP2):= board-flash.o omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o obj-y += $(omap-flash-y) $(omap-flash-m) diff --git a/arch/arm/mach-omap2/board-4430sdp-camera.c b/arch/arm/mach-omap2/board-4430sdp-camera.c new file mode 100644 index 000..e62ee50 --- /dev/null +++ b/arch/arm/mach-omap2/board-4430sdp-camera.c @@ -0,0 +1,221 @@ +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "devices.h" +#include "../../../drivers/media/video/omap4iss/iss.h" + +#include "control.h" +#include "mux.h" + +#define OMAP4430SDP_GPIO_CAM_PDN_C 39 + +static struct clk *sdp4430_cam_aux_clk; + +static int sdp4430_ov5640_power(struct v4l2_subdev *subdev, int on) +{ + struct iss_device *iss = v4l2_dev_to_iss_device(subdev->v4l2_dev); + int ret = 0; + struct iss_csiphy_dphy_cfg dphy; + struct iss_csiphy_lanes_cfg lanes; +#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV5650 + unsigned int ddr_freq = 480; /* FIXME: Do an actual query for this */ +#elif defined(CONFIG_MACH_OMAP_4430SDP_CAM_OV5640) + unsigned int ddr_freq = 336; /* FIXME: Do an actual query for this */ +#endif + + memset(&lanes, 0, sizeof(lanes)); + memset(&dphy, 0, sizeof(dphy)); + + lanes.clk.pos = 1; + lanes.clk.pol = 0; + lanes.data[0].pos = 2; + lanes.data[0].pol = 0; +#ifdef CONFIG_MACH_OMAP_4430SDP_CAM_OV5650 + lanes.data[1].pos = 3; + lanes.data[1].pol = 0; +#endif + + dphy.ths_term = 12500 * ddr_freq + 100) / 100) - 1) & 0xFF); + dphy.ths_settle = 9 * ddr_freq + 100) / 100) + 3) & 0xFF); + dphy.tclk_term = 0; + dphy.tclk_miss = 1; + dphy.tclk_settle = 14; + + if (on) { + u8 gpoctl = 0; + + /* TWL6030_BASEADD_AUX */ + twl_i2c_write_u8(15, 0x00, 0xB); + twl_i2c_write_u8(15, 0x80, 0x1); + + mdelay(50); + + /* TWL6030_BASEADD_PM_SLAVE_MISC */ + twl_i2c_write_u8(21, 0xFF, 0x5E); + twl_i2c_write_u8(21, 0x13, 0x5F); + + mdelay(50); + + twl_i2c_write_u8(15, 0x40, 0x1); + + twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &gpoctl, + TWL6040_REG_GPOCTL); + twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, gpoctl | TWL6040_GPO3, + TWL6040_REG_GPOCTL); + + mdelay(10); + + gpio_set_value(OMAP4430SDP_GPIO_CAM_PDN_C, 1); + mdelay(10); + clk_enable(sdp4430_cam_aux_clk); /* Enable XCLK */ + mdelay(10); + + iss->platform_cb.csiphy_config(&iss->csiphy1, &dphy, &l
[PATCH v2 11/11] arm: Add support for CMA for omap4iss driver
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index b48aeea..e411c4e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -17,6 +17,9 @@ #include #include #include +#ifdef CONFIG_CMA +#include +#endif #include #include @@ -246,6 +249,11 @@ int omap4_init_camera(struct iss_platform_data *pdata, struct omap_board_data *b oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); +#ifdef CONFIG_CMA + /* Create private 32MiB contiguous memory area for omap4iss device */ + dma_declare_contiguous(&pdev->dev, 32*SZ_1M, 0, 0); +#endif + return 0; } -- 1.7.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 08/11] v4l: Add support for ov5650 sensor
Signed-off-by: Sergio Aguirre --- drivers/media/video/Kconfig |6 + drivers/media/video/Makefile|1 + drivers/media/video/ov5650.c| 524 +++ include/media/ov5650.h | 10 + include/media/v4l2-chip-ident.h |1 + 5 files changed, 542 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/ov5650.c create mode 100644 include/media/ov5650.h diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 3ee4fc9..46076a9 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -473,6 +473,12 @@ config VIDEO_OV5640 help This is a ov5640 camera driver +config VIDEO_OV5650 + tristate "OmniVision OV5650 sensor support" + depends on I2C && VIDEO_V4L2 + help + This is a ov5650 camera driver + config VIDEO_MT9P031 tristate "Aptina MT9P031 support" depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index d296c7b..9061cfc 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile @@ -64,6 +64,7 @@ obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o obj-$(CONFIG_VIDEO_OV7670) += ov7670.o obj-$(CONFIG_VIDEO_OV5640) += ov5640.o +obj-$(CONFIG_VIDEO_OV5650) += ov5650.o obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o diff --git a/drivers/media/video/ov5650.c b/drivers/media/video/ov5650.c new file mode 100644 index 000..092d8bf --- /dev/null +++ b/drivers/media/video/ov5650.c @@ -0,0 +1,524 @@ +/* + * OmniVision OV5650 sensor driver + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* OV5650 has only one fixed colorspace per pixelcode */ +struct ov5650_datafmt { + enum v4l2_mbus_pixelcodecode; + enum v4l2_colorspacecolorspace; +}; + +enum ov5650_size { + OV5650_SIZE_5MP, + OV5650_SIZE_LAST, +}; + +static const struct v4l2_frmsize_discrete ov5650_frmsizes[OV5650_SIZE_LAST] = { + { 2592, 1944 }, +}; + +struct ov5650 { + struct v4l2_subdev subdev; + struct media_pad pad; + + struct v4l2_mbus_framefmt format; + + const struct ov5650_platform_data *pdata; +}; + +static inline struct ov5650 *to_ov5650(struct v4l2_subdev *sd) +{ + return container_of(sd, struct ov5650, subdev); +} + +/** + * struct ov5650_reg - ov5650 register format + * @reg: 16-bit offset to register + * @val: 8/16/32-bit register value + * @length: length of the register + * + * Define a structure for OV5650 register initialization values + */ +struct ov5650_reg { + u16 reg; + u8 val; +}; + +/* TODO: Divide this properly */ +static const struct ov5650_reg configscript_5MP[] = { + { 0x3008, 0x82 }, + { 0x3008, 0x42 }, + { 0x3103, 0x93 }, + { 0x3b07, 0x0c }, + { 0x3017, 0xff }, + { 0x3018, 0xfc }, + { 0x3706, 0x41 }, + { 0x3703, 0xe6 }, + { 0x3613, 0x44 }, + { 0x3630, 0x22 }, + { 0x3605, 0x04 }, + { 0x3606, 0x3f }, + { 0x3712, 0x13 }, + { 0x370e, 0x00 }, + { 0x370b, 0x40 }, + { 0x3600, 0x54 }, + { 0x3601, 0x05 }, + { 0x3713, 0x22 }, + { 0x3714, 0x27 }, + { 0x3631, 0x22 }, + { 0x3612, 0x1a }, + { 0x3604, 0x40 }, + { 0x3705, 0xda }, + { 0x370a, 0x80 }, + { 0x370c, 0x00 }, + { 0x3710, 0x28 }, + { 0x3702, 0x3a }, + { 0x3704, 0x18 }, + { 0x3a18, 0x00 }, + { 0x3a19, 0xf8 }, + { 0x3a00, 0x38 }, + { 0x3800, 0x02 }, + { 0x3801, 0x54 }, + { 0x3803, 0x0c }, + { 0x3808, 0x0a }, + { 0x3809, 0x20 }, + { 0x380a, 0x07 }, + { 0x380b, 0x98 }, + { 0x380c, 0x0c }, + { 0x380d, 0xb4 }, + { 0x380e, 0x07 }, + { 0x380f, 0xb0 }, + { 0x3830, 0x50 }, + { 0x3a08, 0x12 }, + { 0x3a09, 0x70 }, + { 0x3a0a, 0x0f }, + { 0x3a0b, 0x60 }, + { 0x3a0d, 0x06 }, + { 0x3a0e, 0x06 }, + { 0x3a13, 0x54 }, + { 0x3815, 0x82 }, + { 0x5059, 0x80 }, + { 0x505a, 0x0a }, + { 0x505b, 0x2e }, + { 0x3a1a, 0x06 }, + { 0x3503, 0x
[PATCH v2 10/11] arm: omap4panda: Add support for omap4iss camera
This adds support for camera interface with the support for following sensors: - OV5640 - OV5650 Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/Kconfig | 27 arch/arm/mach-omap2/Makefile |1 + arch/arm/mach-omap2/board-omap4panda-camera.c | 198 + 3 files changed, 226 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-omap4panda-camera.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index f883abb..0fc5ce9 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -358,6 +358,33 @@ config MACH_OMAP4_PANDA select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE +config MACH_OMAP4_PANDA_CAMERA_SUPPORT + bool "OMAP4 Panda Board Camera support" + depends on MACH_OMAP4_PANDA + select MEDIA_SUPPORT + select MEDIA_CONTROLLER + select VIDEO_DEV + select VIDEO_V4L2_SUBDEV_API + select VIDEO_OMAP4 + help + Enable Camera HW support for PandaBoard. + This is for using the OMAP4 ISS CSI2A Camera sensor + interface. + +choice + prompt "Camera sensor to use" + depends on MACH_OMAP4_PANDA_CAMERA_SUPPORT + default MACH_OMAP4_PANDA_CAM_OV5650 + + config MACH_OMAP4_PANDA_CAM_OV5640 + bool "Use OmniVision OV5640 Camera" + select VIDEO_OV5640 + + config MACH_OMAP4_PANDA_CAM_OV5650 + bool "Use OmniVision OV5650 Camera" + select VIDEO_OV5650 +endchoice + config OMAP3_EMU bool "OMAP3 debugging peripherals" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 8bc446a..e80724d 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -236,6 +236,7 @@ obj-$(CONFIG_MACH_TI8168EVM)+= board-ti8168evm.o # Platform specific device init code obj-$(CONFIG_MACH_OMAP_4430SDP_CAMERA_SUPPORT) += board-4430sdp-camera.o +obj-$(CONFIG_MACH_OMAP4_PANDA_CAMERA_SUPPORT) += board-omap4panda-camera.o omap-flash-$(CONFIG_MTD_NAND_OMAP2):= board-flash.o omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o diff --git a/arch/arm/mach-omap2/board-omap4panda-camera.c b/arch/arm/mach-omap2/board-omap4panda-camera.c new file mode 100644 index 000..02ef36e --- /dev/null +++ b/arch/arm/mach-omap2/board-omap4panda-camera.c @@ -0,0 +1,198 @@ +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "devices.h" +#include "../../../drivers/media/video/omap4iss/iss.h" + +#include "control.h" +#include "mux.h" + +#define PANDA_GPIO_CAM_PWRDN 45 +#define PANDA_GPIO_CAM_RESET 83 + +static struct clk *panda_cam_aux_clk; + +static int panda_ov5640_power(struct v4l2_subdev *subdev, int on) +{ + struct iss_device *iss = v4l2_dev_to_iss_device(subdev->v4l2_dev); + int ret = 0; + struct iss_csiphy_dphy_cfg dphy; + struct iss_csiphy_lanes_cfg lanes; + unsigned int ddr_freq = 480; /* FIXME: Do an actual query for this */ + + memset(&lanes, 0, sizeof(lanes)); + memset(&dphy, 0, sizeof(dphy)); + + lanes.clk.pos = 1; + lanes.clk.pol = 0; + lanes.data[0].pos = 2; + lanes.data[0].pol = 0; + lanes.data[1].pos = 3; + lanes.data[1].pol = 0; + + dphy.ths_term = 12500 * ddr_freq + 100) / 100) - 1) & 0xFF); + dphy.ths_settle = 9 * ddr_freq + 100) / 100) + 3) & 0xFF); + dphy.tclk_term = 0; + dphy.tclk_miss = 1; + dphy.tclk_settle = 14; + + if (on) { + gpio_set_value(PANDA_GPIO_CAM_PWRDN, 0); + clk_enable(panda_cam_aux_clk); + mdelay(2); + + iss->platform_cb.csiphy_config(&iss->csiphy1, &dphy, &lanes); + } else { + clk_disable(panda_cam_aux_clk); + gpio_set_value(PANDA_GPIO_CAM_PWRDN, 1); + } + + return ret; +} + +#define OV5640_I2C_ADDRESS (0x3C) +#define OV5650_I2C_ADDRESS (0x36) + +#ifdef CONFIG_MACH_OMAP4_PANDA_CAM_OV5650 +static struct ov5650_platform_data ov_platform_data = { +#elif defined(CONFIG_MACH_OMAP4_PANDA_CAM_OV5640) +static struct ov5640_platform_data ov_platform_data = { +#endif + .s_power = panda_ov5640_power, +}; + +static struct i2c_board_info ov_camera_i2c_device = { +#ifdef CONFIG_MACH_OMAP4_PANDA_CAM_OV5650 + I2C_BOARD_INFO("ov5650", OV5650_I2C_ADDRESS), +#elif defined(CONFIG_MACH_OMAP4_PANDA_CAM_OV5640) + I2C_BOARD_INFO("ov5640", OV5640_I2C_ADDRESS), +#endif + .platform_data = &ov_platform_data, +}; + +static struct iss_subdev_i2c_board_info ov_camera_subdevs[] = { + { + .board_info = &o
[PATCH v2 02/11] mfd: twl6040: Fix wrong TWL6040_GPO3 bitfield value
The define should be the result of 1 << Bit number. Bit number for GPOCTL.GPO3 field is 2, which results in 0x4 value. Signed-off-by: Sergio Aguirre --- include/linux/mfd/twl6040.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index 2463c261..2a7ff16 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h @@ -142,7 +142,7 @@ #define TWL6040_GPO1 0x01 #define TWL6040_GPO2 0x02 -#define TWL6040_GPO3 0x03 +#define TWL6040_GPO3 0x04 /* ACCCTL (0x2D) fields */ -- 1.7.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 01/11] TWL6030: Add mapping for auxiliary regs
Signed-off-by: Sergio Aguirre --- drivers/mfd/twl-core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index bfbd660..e26b564 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -323,7 +323,7 @@ static struct twl_mapping twl6030_map[] = { { SUB_CHIP_ID0, TWL6030_BASEADD_ZERO }, { SUB_CHIP_ID1, TWL6030_BASEADD_ZERO }, - { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO }, + { SUB_CHIP_ID1, TWL6030_BASEADD_AUX }, { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO }, { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, { SUB_CHIP_ID2, TWL6030_BASEADD_RSV }, -- 1.7.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] v4l: soc-camera: Store negotiated buffer settings
On 03/11/2011 10:48 AM, Guennadi Liakhovetski wrote: On Fri, 11 Mar 2011, Sergio Aguirre wrote: Hi Guennadi, On 03/11/2011 10:36 AM, Guennadi Liakhovetski wrote: On Tue, 8 Mar 2011, Sergio Aguirre wrote: Hi Guennadi, On 03/08/2011 01:19 AM, Guennadi Liakhovetski wrote: On Mon, 7 Mar 2011, Sergio Aguirre wrote: This fixes the problem in which a host driver sets a personalized sizeimage or bytesperline field, and gets ignored when doing G_FMT. Can you tell what that personalised value is? Is it not covered by soc_mbus_bytes_per_line()? Maybe something like a JPEG format? In my case, my omap4_camera driver requires to have a bytesperline which is a multiple of 32, and sometimes (depending on the internal HW blocks used) a page aligned byte offset between lines. For example, I want to use such configuration that, for an NV12 buffer, I require a 4K offset between lines, so the vaues are: pix->bytesperline = PAGE_SIZE; pix->sizeimage = pix->bytesperline * height * 3 / 2; Which I filled in TRY_FMT/S_FMT ioctl calls. Ok, I think, I agree with this. Until now we didn't have drivers, that wanted to pad data. Even the pxa270 driver adjusts the frame format (see pxa_camera.c::pxa_camera_try_fmt() and the call to v4l_bound_align_image() there in the YUV422P case) to avoid padding, even though that's a different kind of padding - between planes. So, if line padding - as in your case - is indeed needed, I agree, that the correct way to support that is to implement driver-specific bytesperline and sizeimage calculations and, logically, those values should be used in soc_camera_g_fmt_vid_cap(). I'll just change your patch a bit - I'll use "u32" types instead of "__u32" - this is a kernel internal struct and we don't need user-space exported types. Ok, thanks. You're right about u32 type... my bad. So, I'll change that, rebase to: git://linuxtv.org/media_tree.gitstaging/for_v2.6.39 And resubmit for review. No problem. Np, I've already committed (locally, not pushed yet) this patch with only changed field types and a bit shuffled lines to group size-related and format-related assignments together. Oh ok. That's good! Thanks for doing that. :) Thanks, Sergio Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] V4L: soc-camera: Add support for custom host mmap
On 03/08/2011 07:45 AM, Guennadi Liakhovetski wrote: On Tue, 8 Mar 2011, Sergio Aguirre wrote: Hi Guennadi, On 03/08/2011 01:17 AM, Guennadi Liakhovetski wrote: Hi Sergio On Mon, 7 Mar 2011, Sergio Aguirre wrote: This helps redirect mmap calls to custom memory managers which already have preallocated space to use by the device. Otherwise, device might not support the allocation attempted generically by videobuf. Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |7 ++- include/media/soc_camera.h |2 ++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 59dc71d..d361ba0 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -512,6 +512,7 @@ static ssize_t soc_camera_read(struct file *file, char __user *buf, static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) { struct soc_camera_device *icd = file->private_data; + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); This doesn't seem to be needed It's needed to call the custom mmaper. ici->ops->mmap Oops, sorry, diff context has confused me "@@ -512,6 +512,7 @@ static ssize_t soc_camera_read(";-) No worries. :) Otherwise, how can I access the soc camera host ops? int err; dev_dbg(&icd->dev, "mmap called, vma=0x%08lx\n", (unsigned long)vma); @@ -519,7 +520,11 @@ static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) if (icd->streamer != file) return -EBUSY; - err = videobuf_mmap_mapper(&icd->vb_vidq, vma); + /* Check for an interface custom mmaper */ mmapper - double 'p' Oops. Will fix. + if (ici->ops->mmap) + err = ici->ops->mmap(&icd->vb_vidq, icd, vma); + else + err = videobuf_mmap_mapper(&icd->vb_vidq, vma); You're patching an old version of soc-camera. Please use a current one with support for videobuf2. Further, wouldn't it be possible for you to just replace the videobuf mmap_mapper() (videobuf2 q->mem_ops->mmap()) method? I am not sure how possible this is, maybe one of videobuf2 experts could help us? BTW, you really should be using the videobuf2 API. I'm basing this patches on mainline, commit: commit 214d93b02c4fe93638ad268613c9702a81ed9192 Merge: ad4a4a8 077f8ec Author: Linus Torvalds Date: Mon Mar 7 13:15:02 2011 -0800 Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 And i don't see videobuf2 there. Should I rebase my patches on another tree? Yes, please use git://linuxtv.org/media_tree.gitstaging/for_v2.6.39 Ok, I'll do this later on. I'm currently developing my driver on an internal TI tree, based on 2.6.35.6 Android kernel, and rebasing just generic v4l2 changes to send for review. I still need to try this driver out in mainline for the Pandaboard, and then I'll rebase everything on top of videobuf2 framework. Bottom line: Holding this patch for now :) Thanks for your time! Sergio otherwise you can also base on linux-next if you like. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] v4l: soc-camera: Store negotiated buffer settings
Hi Guennadi, On 03/11/2011 10:36 AM, Guennadi Liakhovetski wrote: On Tue, 8 Mar 2011, Sergio Aguirre wrote: Hi Guennadi, On 03/08/2011 01:19 AM, Guennadi Liakhovetski wrote: On Mon, 7 Mar 2011, Sergio Aguirre wrote: This fixes the problem in which a host driver sets a personalized sizeimage or bytesperline field, and gets ignored when doing G_FMT. Can you tell what that personalised value is? Is it not covered by soc_mbus_bytes_per_line()? Maybe something like a JPEG format? In my case, my omap4_camera driver requires to have a bytesperline which is a multiple of 32, and sometimes (depending on the internal HW blocks used) a page aligned byte offset between lines. For example, I want to use such configuration that, for an NV12 buffer, I require a 4K offset between lines, so the vaues are: pix->bytesperline = PAGE_SIZE; pix->sizeimage = pix->bytesperline * height * 3 / 2; Which I filled in TRY_FMT/S_FMT ioctl calls. Ok, I think, I agree with this. Until now we didn't have drivers, that wanted to pad data. Even the pxa270 driver adjusts the frame format (see pxa_camera.c::pxa_camera_try_fmt() and the call to v4l_bound_align_image() there in the YUV422P case) to avoid padding, even though that's a different kind of padding - between planes. So, if line padding - as in your case - is indeed needed, I agree, that the correct way to support that is to implement driver-specific bytesperline and sizeimage calculations and, logically, those values should be used in soc_camera_g_fmt_vid_cap(). I'll just change your patch a bit - I'll use "u32" types instead of "__u32" - this is a kernel internal struct and we don't need user-space exported types. Ok, thanks. You're right about u32 type... my bad. So, I'll change that, rebase to: git://linuxtv.org/media_tree.gitstaging/for_v2.6.39 And resubmit for review. No problem. Regards, Sergio Thanks Guennadi So, next time a driver tries a G_FMT, it currently gets recalculated by a prefixed table (which comes from soc_mbus_bytes_per_line), which won't give me what i had set before. And it will also recalculate a size image based on this wrong bytesperline * height, which is also wrong, (lacks the * 3 / 2 for NV12). Regards, Sergio Thanks Guennadi Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |9 - include/media/soc_camera.h |2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a66811b..59dc71d 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -363,6 +363,8 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, icd->user_width = pix->width; icd->user_height = pix->height; icd->colorspace = pix->colorspace; + icd->bytesperline= pix->bytesperline; + icd->sizeimage = pix->sizeimage; icd->vb_vidq.field = icd->field = pix->field; @@ -608,12 +610,9 @@ static int soc_camera_g_fmt_vid_cap(struct file *file, void *priv, pix->height = icd->user_height; pix->field = icd->vb_vidq.field; pix->pixelformat = icd->current_fmt->host_fmt->fourcc; - pix->bytesperline= soc_mbus_bytes_per_line(pix->width, - icd->current_fmt->host_fmt); + pix->bytesperline= icd->bytesperline; pix->colorspace = icd->colorspace; - if (pix->bytesperline< 0) - return pix->bytesperline; - pix->sizeimage = pix->height * pix->bytesperline; + pix->sizeimage = icd->sizeimage; dev_dbg(&icd->dev, "current_fmt->fourcc: 0x%08x\n", icd->current_fmt->host_fmt->fourcc); return 0; diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 9386db8..de81370 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -30,6 +30,8 @@ struct soc_camera_device { s32 user_width; s32 user_height; enum v4l2_colorspace colorspace; + __u32 bytesperline; /* for padding, zero if unused */ + __u32 sizeimage; unsigned char iface;/* Host number */ unsigned char devnum; /* Device number per host */ struct soc_camera_sense *sense; /* See comment in struct definition */ -- 1.7.1 --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] V4L: soc-camera: Add support for custom host mmap
Hi Guennadi, On 03/08/2011 01:17 AM, Guennadi Liakhovetski wrote: Hi Sergio On Mon, 7 Mar 2011, Sergio Aguirre wrote: This helps redirect mmap calls to custom memory managers which already have preallocated space to use by the device. Otherwise, device might not support the allocation attempted generically by videobuf. Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |7 ++- include/media/soc_camera.h |2 ++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 59dc71d..d361ba0 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -512,6 +512,7 @@ static ssize_t soc_camera_read(struct file *file, char __user *buf, static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) { struct soc_camera_device *icd = file->private_data; + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); This doesn't seem to be needed It's needed to call the custom mmaper. ici->ops->mmap Otherwise, how can I access the soc camera host ops? int err; dev_dbg(&icd->dev, "mmap called, vma=0x%08lx\n", (unsigned long)vma); @@ -519,7 +520,11 @@ static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) if (icd->streamer != file) return -EBUSY; - err = videobuf_mmap_mapper(&icd->vb_vidq, vma); + /* Check for an interface custom mmaper */ mmapper - double 'p' Oops. Will fix. + if (ici->ops->mmap) + err = ici->ops->mmap(&icd->vb_vidq, icd, vma); + else + err = videobuf_mmap_mapper(&icd->vb_vidq, vma); You're patching an old version of soc-camera. Please use a current one with support for videobuf2. Further, wouldn't it be possible for you to just replace the videobuf mmap_mapper() (videobuf2 q->mem_ops->mmap()) method? I am not sure how possible this is, maybe one of videobuf2 experts could help us? BTW, you really should be using the videobuf2 API. I'm basing this patches on mainline, commit: commit 214d93b02c4fe93638ad268613c9702a81ed9192 Merge: ad4a4a8 077f8ec Author: Linus Torvalds Date: Mon Mar 7 13:15:02 2011 -0800 Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 And i don't see videobuf2 there. Should I rebase my patches on another tree? Regards, Sergio dev_dbg(&icd->dev, "vma start=0x%08lx, size=%ld, ret=%d\n", (unsigned long)vma->vm_start, diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index de81370..11350c2 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -87,6 +87,8 @@ struct soc_camera_host_ops { int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); + int (*mmap)(struct videobuf_queue *, struct soc_camera_device *, +struct vm_area_struct *); unsigned int (*poll)(struct file *, poll_table *); const struct v4l2_queryctrl *controls; int num_controls; -- 1.7.1 Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] v4l: soc-camera: Store negotiated buffer settings
Hi Guennadi, On 03/08/2011 01:19 AM, Guennadi Liakhovetski wrote: On Mon, 7 Mar 2011, Sergio Aguirre wrote: This fixes the problem in which a host driver sets a personalized sizeimage or bytesperline field, and gets ignored when doing G_FMT. Can you tell what that personalised value is? Is it not covered by soc_mbus_bytes_per_line()? Maybe something like a JPEG format? In my case, my omap4_camera driver requires to have a bytesperline which is a multiple of 32, and sometimes (depending on the internal HW blocks used) a page aligned byte offset between lines. For example, I want to use such configuration that, for an NV12 buffer, I require a 4K offset between lines, so the vaues are: pix->bytesperline = PAGE_SIZE; pix->sizeimage = pix->bytesperline * height * 3 / 2; Which I filled in TRY_FMT/S_FMT ioctl calls. So, next time a driver tries a G_FMT, it currently gets recalculated by a prefixed table (which comes from soc_mbus_bytes_per_line), which won't give me what i had set before. And it will also recalculate a size image based on this wrong bytesperline * height, which is also wrong, (lacks the * 3 / 2 for NV12). Regards, Sergio Thanks Guennadi Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |9 - include/media/soc_camera.h |2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a66811b..59dc71d 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -363,6 +363,8 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, icd->user_width = pix->width; icd->user_height = pix->height; icd->colorspace = pix->colorspace; + icd->bytesperline= pix->bytesperline; + icd->sizeimage = pix->sizeimage; icd->vb_vidq.field = icd->field = pix->field; @@ -608,12 +610,9 @@ static int soc_camera_g_fmt_vid_cap(struct file *file, void *priv, pix->height = icd->user_height; pix->field = icd->vb_vidq.field; pix->pixelformat = icd->current_fmt->host_fmt->fourcc; - pix->bytesperline= soc_mbus_bytes_per_line(pix->width, - icd->current_fmt->host_fmt); + pix->bytesperline= icd->bytesperline; pix->colorspace = icd->colorspace; - if (pix->bytesperline< 0) - return pix->bytesperline; - pix->sizeimage = pix->height * pix->bytesperline; + pix->sizeimage = icd->sizeimage; dev_dbg(&icd->dev, "current_fmt->fourcc: 0x%08x\n", icd->current_fmt->host_fmt->fourcc); return 0; diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 9386db8..de81370 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -30,6 +30,8 @@ struct soc_camera_device { s32 user_width; s32 user_height; enum v4l2_colorspace colorspace; + __u32 bytesperline; /* for padding, zero if unused */ + __u32 sizeimage; unsigned char iface;/* Host number */ unsigned char devnum; /* Device number per host */ struct soc_camera_sense *sense; /* See comment in struct definition */ -- 1.7.1 --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] V4L: soc-camera: Add support for custom host mmap
This helps redirect mmap calls to custom memory managers which already have preallocated space to use by the device. Otherwise, device might not support the allocation attempted generically by videobuf. Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |7 ++- include/media/soc_camera.h |2 ++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 59dc71d..d361ba0 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -512,6 +512,7 @@ static ssize_t soc_camera_read(struct file *file, char __user *buf, static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) { struct soc_camera_device *icd = file->private_data; + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); int err; dev_dbg(&icd->dev, "mmap called, vma=0x%08lx\n", (unsigned long)vma); @@ -519,7 +520,11 @@ static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) if (icd->streamer != file) return -EBUSY; - err = videobuf_mmap_mapper(&icd->vb_vidq, vma); + /* Check for an interface custom mmaper */ + if (ici->ops->mmap) + err = ici->ops->mmap(&icd->vb_vidq, icd, vma); + else + err = videobuf_mmap_mapper(&icd->vb_vidq, vma); dev_dbg(&icd->dev, "vma start=0x%08lx, size=%ld, ret=%d\n", (unsigned long)vma->vm_start, diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index de81370..11350c2 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -87,6 +87,8 @@ struct soc_camera_host_ops { int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); + int (*mmap)(struct videobuf_queue *, struct soc_camera_device *, +struct vm_area_struct *); unsigned int (*poll)(struct file *, poll_table *); const struct v4l2_queryctrl *controls; int num_controls; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] v4l: soc-camera: Store negotiated buffer settings
This fixes the problem in which a host driver sets a personalized sizeimage or bytesperline field, and gets ignored when doing G_FMT. Signed-off-by: Sergio Aguirre --- drivers/media/video/soc_camera.c |9 - include/media/soc_camera.h |2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a66811b..59dc71d 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -363,6 +363,8 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, icd->user_width = pix->width; icd->user_height= pix->height; icd->colorspace = pix->colorspace; + icd->bytesperline = pix->bytesperline; + icd->sizeimage = pix->sizeimage; icd->vb_vidq.field = icd->field = pix->field; @@ -608,12 +610,9 @@ static int soc_camera_g_fmt_vid_cap(struct file *file, void *priv, pix->height = icd->user_height; pix->field = icd->vb_vidq.field; pix->pixelformat= icd->current_fmt->host_fmt->fourcc; - pix->bytesperline = soc_mbus_bytes_per_line(pix->width, - icd->current_fmt->host_fmt); + pix->bytesperline = icd->bytesperline; pix->colorspace = icd->colorspace; - if (pix->bytesperline < 0) - return pix->bytesperline; - pix->sizeimage = pix->height * pix->bytesperline; + pix->sizeimage = icd->sizeimage; dev_dbg(&icd->dev, "current_fmt->fourcc: 0x%08x\n", icd->current_fmt->host_fmt->fourcc); return 0; diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 9386db8..de81370 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -30,6 +30,8 @@ struct soc_camera_device { s32 user_width; s32 user_height; enum v4l2_colorspace colorspace; + __u32 bytesperline; /* for padding, zero if unused */ + __u32 sizeimage; unsigned char iface;/* Host number */ unsigned char devnum; /* Device number per host */ struct soc_camera_sense *sense; /* See comment in struct definition */ -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Query][soc_camera] How to handle hosts w/color conversion built in?
Hi Guennadi, Thanks for replying. On 03/07/2011 03:05 PM, Guennadi Liakhovetski wrote: On Mon, 7 Mar 2011, Sergio Aguirre wrote: Hi Guennadi and all, I've been trying to make my omap4 camera host driver to allow YUYV -> NV12 color conversion, and add that to the supported host-client formats, but I think I have hit the wall with the host design. I noticed that the soc_camera seems to be designed to just pass-through the client supported formats (i.e. if my sensor supports YUYV and JPEG, those will be the supported formats only) No, this is not the case. Ok. Now, in my host driver, I have a feature to do a color conversion to NV12, but I'm still not sure on how to expand the supported formats to, say: YUYV, JPEG, and NV12 (which would be available only if the client outputs YUYV, of course). I was trying adding a customized get_formats function, but as soc_camera_init_user_formats anyways depends heavly on the sensor's enum_mbus_fmt, it's hard to add supported formats that the sensor doesn't directly support. Has this been done before? Any advice? Of course, this is supported. See sh_mobile_ceu.c, mx3_camera, pxa_camera, omap1_camera. Just search for the format array defined with "static const struct soc_mbus_pixelfmt" and see how it is used. Feel free to ask again, if you have more questions. Ahh... OK. I understand now :) So, you basically first determine the count of sensor formats, by looping through enum_mbus_fmt in the sensor, and with every call to get_formats with the index range, you can return 2 or more formats. In my case, when the sensor supports YUYV, I'll return 2 and update the xlate array with 2 entries, instead of just one, is that right? Sorry for the noise, and thanks for the patience :) I've been focusing more on the actual HW functionality, rather than the clean design. But now it's time to clean things up and prepare for upstreaming :) Regards, Sergio Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[Query][soc_camera] How to handle hosts w/color conversion built in?
Hi Guennadi and all, I've been trying to make my omap4 camera host driver to allow YUYV -> NV12 color conversion, and add that to the supported host-client formats, but I think I have hit the wall with the host design. I noticed that the soc_camera seems to be designed to just pass-through the client supported formats (i.e. if my sensor supports YUYV and JPEG, those will be the supported formats only) Now, in my host driver, I have a feature to do a color conversion to NV12, but I'm still not sure on how to expand the supported formats to, say: YUYV, JPEG, and NV12 (which would be available only if the client outputs YUYV, of course). I was trying adding a customized get_formats function, but as soc_camera_init_user_formats anyways depends heavly on the sensor's enum_mbus_fmt, it's hard to add supported formats that the sensor doesn't directly support. Has this been done before? Any advice? Regards, Sergio -- 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
[omap3isp RFC][RESEND PATCH v2 1/4] omap3isp: Abstract isp subdevs clock control
Submodules shouldn't be aware of global register bit structure, specially if the submodules are shared in the future with other TI architectures (Davinci, future OMAPs, etc) Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c| 46 ++ drivers/media/video/isp/isp.h| 12 + drivers/media/video/isp/ispccdc.c|6 +--- drivers/media/video/isp/isppreview.c |6 +--- drivers/media/video/isp/ispresizer.c |6 +--- 5 files changed, 64 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 30bdc48..1ff7193 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -991,6 +991,52 @@ void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res) * Clock management */ +#define ISPCTRL_CLKS_MASK (ISPCTRL_H3A_CLK_EN | \ +ISPCTRL_HIST_CLK_EN | \ +ISPCTRL_RSZ_CLK_EN | \ +(ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN) | \ +(ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN)) + +static void __isp_subclk_update(struct isp_device *isp) +{ + u32 clk = 0; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A) + clk |= ISPCTRL_H3A_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST) + clk |= ISPCTRL_HIST_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER) + clk |= ISPCTRL_RSZ_CLK_EN; + + /* NOTE: For CCDC & Preview submodules, we need to affect internal +* RAM aswell. +*/ + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC) + clk |= ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW) + clk |= ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN; + + isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, + ISPCTRL_CLKS_MASK, clk); +} + +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res) +{ + isp->subclk_resources |= res; + + __isp_subclk_update(isp); +} + +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res) +{ + isp->subclk_resources &= ~res; + + __isp_subclk_update(isp); +} + /* * isp_enable_clocks - Enable ISP clocks * @isp: OMAP3 ISP device diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index b8f63e2..5edbc86 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -85,6 +85,14 @@ enum isp_sbl_resource { OMAP3_ISP_SBL_RESIZER_WRITE = 0x200, }; +enum isp_subclk_resource { + OMAP3_ISP_SUBCLK_CCDC = (1 << 0), + OMAP3_ISP_SUBCLK_H3A= (1 << 1), + OMAP3_ISP_SUBCLK_HIST = (1 << 2), + OMAP3_ISP_SUBCLK_PREVIEW= (1 << 3), + OMAP3_ISP_SUBCLK_RESIZER= (1 << 4), +}; + enum isp_interface_type { ISP_INTERFACE_PARALLEL, ISP_INTERFACE_CSI2A_PHY2, @@ -262,6 +270,7 @@ struct isp_device { struct isp_csiphy isp_csiphy2; unsigned int sbl_resources; + unsigned int subclk_resources; struct iommu *iommu; }; @@ -294,6 +303,9 @@ void isp_print_status(struct isp_device *isp); void isp_sbl_enable(struct isp_device *isp, enum isp_sbl_resource res); void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res); +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res); +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res); + int omap3isp_register_entities(struct platform_device *pdev, struct v4l2_device *v4l2_dev); void omap3isp_unregister_entities(struct platform_device *pdev); diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index c3d1d7a..4244edf 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1687,8 +1687,7 @@ static int ccdc_set_stream(struct v4l2_subdev *sd, int enable) if (enable == ISP_PIPELINE_STREAM_STOPPED) return 0; - isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, - ISPCTRL_CCDC_RAM_EN | ISPCTRL_CCDC_CLK_EN); + isp_subclk_enable(isp, OMAP3_ISP_SUBCLK_CCDC); isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_VDLC); @@ -1725,8 +1724,7 @@ static int ccdc_set_stream(struct v4l2_subdev *sd, int enable) ret = ispccdc_disable(ccdc); if (ccdc->output & CCDC_OUTPUT_MEMORY) isp_sbl_disable(isp, OMAP3_ISP_SBL_CCDC_WRITE); - isp_reg_clr(isp, OMAP3_ISP_
[omap3isp RFC][RESEND PATCH v2 3/4] omap3isp: sbl: Abstract SBL busy check
Make a nicer interface that can be used by anyone accessing the isp. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 17 + drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 10 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index d0500b9..4ca1a73 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -362,6 +362,23 @@ int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp) return -ETIMEDOUT; } +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res) +{ + int ret = 0; + + if (res & OMAP3_ISP_SBL_CCDC_WRITE) { + ret |= (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & + ISPSBL_CCDC_WR_0_DATA_READY); + } + + return ret; +} static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index a0149a0..61e0b12 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -282,6 +282,8 @@ void isphist_dma_done(struct isp_device *isp); int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp); +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 9bc1ace..a2fb503 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1217,15 +1217,7 @@ static int ispccdc_sbl_busy(struct isp_ccdc_device *ccdc) { struct isp_device *isp = to_isp_device(ccdc); - return ispccdc_busy(ccdc) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & - ISPSBL_CCDC_WR_0_DATA_READY); + return ispccdc_busy(ccdc) | isp_sbl_busy(isp, OMAP3_ISP_SBL_CCDC_WRITE); } /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][RESEND PATCH v2 2/4] omap3isp: Move CCDC LSC prefetch wait to main isp code
Since this sequence strictly touches ISP global registers, it's not really part of the same register address space than the CCDC. Do this check in main isp code instead. Also, rename function from ispccdc_lsc_* to isp_ccdc_lsc_*. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 24 drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 26 +- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 1ff7193..d0500b9 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -339,6 +339,30 @@ void isphist_dma_done(struct isp_device *isp) } } +int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp) +{ + unsigned int wait; + + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + + /* timeout 1 ms */ + for (wait = 0; wait < 1000; wait++) { + if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & + IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + return 0; + } + + rmb(); + udelay(1); + } + + return -ETIMEDOUT; +} + + static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { static const char *name[] = { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index 5edbc86..a0149a0 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -280,6 +280,8 @@ struct isp_device { void isphist_dma_done(struct isp_device *isp); +int isp_ccdc_lsc_wait_prefetch(struct isp_device *isp); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 4244edf..9bc1ace 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -223,30 +223,6 @@ static void ispccdc_lsc_setup_regs(struct isp_ccdc_device *ccdc, ISPCCDC_LSC_INITIAL); } -static int ispccdc_lsc_wait_prefetch(struct isp_ccdc_device *ccdc) -{ - struct isp_device *isp = to_isp_device(ccdc); - unsigned int wait; - - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - - /* timeout 1 ms */ - for (wait = 0; wait < 1000; wait++) { - if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & - IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - return 0; - } - - rmb(); - udelay(1); - } - - return -ETIMEDOUT; -} - /* * __ispccdc_lsc_enable - Enables/Disables the Lens Shading Compensation module. * @ccdc: Pointer to ISP CCDC device. @@ -272,7 +248,7 @@ static int __ispccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable) ISPCCDC_LSC_ENABLE, enable ? ISPCCDC_LSC_ENABLE : 0); if (enable) { - if (ispccdc_lsc_wait_prefetch(ccdc) < 0) { + if (isp_ccdc_lsc_wait_prefetch(isp) < 0) { isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG, ISPCCDC_LSC_ENABLE); ccdc->lsc.state = LSC_STATE_STOPPED; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][RESEND PATCH v2 4/4] omap3isp: csi2: Don't dump ISP main registers
This keeps the driver focused only on accessing CSI2 registers only. if the same info is needed, isp_print_status should be called instead. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispcsi2.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/isp/ispcsi2.c b/drivers/media/video/isp/ispcsi2.c index 35e3629..13e7e22 100644 --- a/drivers/media/video/isp/ispcsi2.c +++ b/drivers/media/video/isp/ispcsi2.c @@ -611,13 +611,6 @@ void isp_csi2_regdump(struct isp_csi2_device *csi2) dev_dbg(isp->dev, "-CSI2 Register dump-\n"); - dev_dbg(isp->dev, "###ISP_CTRL=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL)); - dev_dbg(isp->dev, "###ISP_IRQ0ENABLE=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE)); - dev_dbg(isp->dev, "###ISP_IRQ0STATUS=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS)); - CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSCONFIG); CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSSTATUS); CSI2_PRINT_REGISTER(isp, csi2->regs1, IRQENABLE); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][RESEND PATCH v2 0/4] Improve inter subdev interaction
(Resending...) Hi, These are some patches to make these operations more generic: - Clock control is being controlled in a very crude manner by subdevices, it should be centralized in isp.c. - LSC prefetch wait check is reading a main ISP register, so move it to isp.c - Abstract SBL busy check: we don't want a submodule thinkering with main ISP registers. That should be done in the main isp.c Also, remove main ISP register dump from CSI2 specific dump. We should be using isp_print_status if we'll like to know main ISP regdump. Comments are welcome. More cleanups for better subdevice isolation are on the way. Regards, Sergio Changelog: v2: - Improved logic in isp subdevs clock control (Thanks David Cohen) - Renamed ispccdc_lsc_wait_prefetch -> isp_ccdc_* to be clear on function declaration new location (isp.c) (Thanks David and Laurent) v1: - Initial version Sergio Aguirre (4): omap3isp: Abstract isp subdevs clock control omap3isp: Move CCDC LSC prefetch wait to main isp code omap3isp: sbl: Abstract SBL busy check omap3isp: csi2: Don't dump ISP main registers drivers/media/video/isp/isp.c| 87 ++ drivers/media/video/isp/isp.h| 16 ++ drivers/media/video/isp/ispccdc.c| 42 ++--- drivers/media/video/isp/ispcsi2.c|7 --- drivers/media/video/isp/isppreview.c |6 +-- drivers/media/video/isp/ispresizer.c |6 +-- 6 files changed, 111 insertions(+), 53 deletions(-) -- 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
[omap3isp RFC][PATCH v2 1/4] omap3isp: Abstract isp subdevs clock control
Submodules shouldn't be aware of global register bit structure, specially if the submodules are shared in the future with other TI architectures (Davinci, future OMAPs, etc) Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c| 54 ++ drivers/media/video/isp/isp.h| 12 +++ drivers/media/video/isp/ispccdc.c|6 +-- drivers/media/video/isp/isppreview.c |6 +-- drivers/media/video/isp/ispresizer.c |6 +-- 5 files changed, 72 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 30bdc48..2e5030f 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -991,6 +991,60 @@ void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res) * Clock management */ +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res) +{ + u32 clk = 0; + + isp->subclk_resources |= res; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A) + clk |= ISPCTRL_H3A_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST) + clk |= ISPCTRL_HIST_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER) + clk |= ISPCTRL_RSZ_CLK_EN; + + /* NOTE: For CCDC & Preview submodules, we need to affect internal +* RAM aswell. +*/ + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC) + clk |= ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW) + clk |= ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN; + + isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, clk); +} + +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res) +{ + u32 clk = 0; + + isp->subclk_resources &= ~res; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A)) + clk |= ISPCTRL_H3A_CLK_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST)) + clk |= ISPCTRL_HIST_CLK_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER)) + clk |= ISPCTRL_RSZ_CLK_EN; + + /* NOTE: For CCDC & Preview submodules, we need to affect internal +* RAM aswell. +*/ + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC)) + clk |= ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW)) + clk |= ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN; + + isp_reg_clr(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, clk); +} + /* * isp_enable_clocks - Enable ISP clocks * @isp: OMAP3 ISP device diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index b8f63e2..1260e9f 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -85,6 +85,14 @@ enum isp_sbl_resource { OMAP3_ISP_SBL_RESIZER_WRITE = 0x200, }; +enum isp_subclk_resource { + OMAP3_ISP_SUBCLK_CCDC = 0x1, + OMAP3_ISP_SUBCLK_H3A= 0x2, + OMAP3_ISP_SUBCLK_HIST = 0x4, + OMAP3_ISP_SUBCLK_PREVIEW= 0x8, + OMAP3_ISP_SUBCLK_RESIZER= 0x10, +}; + enum isp_interface_type { ISP_INTERFACE_PARALLEL, ISP_INTERFACE_CSI2A_PHY2, @@ -262,6 +270,7 @@ struct isp_device { struct isp_csiphy isp_csiphy2; unsigned int sbl_resources; + unsigned int subclk_resources; struct iommu *iommu; }; @@ -294,6 +303,9 @@ void isp_print_status(struct isp_device *isp); void isp_sbl_enable(struct isp_device *isp, enum isp_sbl_resource res); void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res); +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res); +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res); + int omap3isp_register_entities(struct platform_device *pdev, struct v4l2_device *v4l2_dev); void omap3isp_unregister_entities(struct platform_device *pdev); diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index c3d1d7a..4244edf 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1687,8 +1687,7 @@ static int ccdc_set_stream(struct v4l2_subdev *sd, int enable) if (enable == ISP_PIPELINE_STREAM_STOPPED) return 0; - isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, - ISPCTRL_CCDC_RAM_EN | ISPCTRL_CCDC_CLK_EN); + isp_subclk_enable(isp, OMAP3_ISP_SUBCLK_CCDC); isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_VDLC); @@ -1725,8 +1724,7 @@ static int ccdc_set_stream(struct v4l2_subdev *s
[omap3isp RFC][PATCH v2 2/4] omap3isp: Move CCDC LSC prefetch wait to main isp code
Since this sequence strictly touches ISP global registers, it's not really part of the same register address space than the CCDC. Do this check in main isp code instead. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 24 drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 26 +- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 2e5030f..ee45eb6 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -339,6 +339,30 @@ void isphist_dma_done(struct isp_device *isp) } } +int ispccdc_lsc_wait_prefetch(struct isp_device *isp) +{ + unsigned int wait; + + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + + /* timeout 1 ms */ + for (wait = 0; wait < 1000; wait++) { + if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & + IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + return 0; + } + + rmb(); + udelay(1); + } + + return -ETIMEDOUT; +} + + static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { static const char *name[] = { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index 1260e9f..d0b7b0f 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -280,6 +280,8 @@ struct isp_device { void isphist_dma_done(struct isp_device *isp); +int ispccdc_lsc_wait_prefetch(struct isp_device *isp); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 4244edf..b039bce 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -223,30 +223,6 @@ static void ispccdc_lsc_setup_regs(struct isp_ccdc_device *ccdc, ISPCCDC_LSC_INITIAL); } -static int ispccdc_lsc_wait_prefetch(struct isp_ccdc_device *ccdc) -{ - struct isp_device *isp = to_isp_device(ccdc); - unsigned int wait; - - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - - /* timeout 1 ms */ - for (wait = 0; wait < 1000; wait++) { - if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & - IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - return 0; - } - - rmb(); - udelay(1); - } - - return -ETIMEDOUT; -} - /* * __ispccdc_lsc_enable - Enables/Disables the Lens Shading Compensation module. * @ccdc: Pointer to ISP CCDC device. @@ -272,7 +248,7 @@ static int __ispccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable) ISPCCDC_LSC_ENABLE, enable ? ISPCCDC_LSC_ENABLE : 0); if (enable) { - if (ispccdc_lsc_wait_prefetch(ccdc) < 0) { + if (ispccdc_lsc_wait_prefetch(isp) < 0) { isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG, ISPCCDC_LSC_ENABLE); ccdc->lsc.state = LSC_STATE_STOPPED; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH v2 3/4] omap3isp: sbl: Abstract SBL busy check
Make a nicer interface that can be used by anyone accessing the isp. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 17 + drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 10 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index ee45eb6..9db2145 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -362,6 +362,23 @@ int ispccdc_lsc_wait_prefetch(struct isp_device *isp) return -ETIMEDOUT; } +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res) +{ + int ret = 0; + + if (res & OMAP3_ISP_SBL_CCDC_WRITE) { + ret |= (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & + ISPSBL_CCDC_WR_0_DATA_READY); + } + + return ret; +} static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index d0b7b0f..1948e23 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -282,6 +282,8 @@ void isphist_dma_done(struct isp_device *isp); int ispccdc_lsc_wait_prefetch(struct isp_device *isp); +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index b039bce..9220d09 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1217,15 +1217,7 @@ static int ispccdc_sbl_busy(struct isp_ccdc_device *ccdc) { struct isp_device *isp = to_isp_device(ccdc); - return ispccdc_busy(ccdc) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & - ISPSBL_CCDC_WR_0_DATA_READY); + return ispccdc_busy(ccdc) | isp_sbl_busy(isp, OMAP3_ISP_SBL_CCDC_WRITE); } /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH v2 0/4] Improve inter subdev interaction
Hi, These are some patches to make these operations more generic: - Clock control is being controlled in a very crude manner by subdevices, it should be centralized in isp.c. - LSC prefetch wait check is reading a main ISP register, so move it to isp.c - Abstract SBL busy check: we don't want a submodule thinkering with main ISP registers. That should be done in the main isp.c Also, remove main ISP register dump from CSI2 specific dump. We should be using isp_print_status if we'll like to know main ISP regdump. Comments are welcome. More cleanups for better subdevice isolation are on the way. Regards, Sergio Changelog: v2: - Improved logic in isp subdevs clock control (Thanks David Cohen) - Renamed ispccdc_lsc_wait_prefetch -> isp_ccdc_* to be clear on function declaration new location (isp.c) (Thanks David and Laurent) v1: - Initial version Sergio Aguirre (4): omap3isp: Abstract isp subdevs clock control omap3isp: Move CCDC LSC prefetch wait to main isp code omap3isp: sbl: Abstract SBL busy check omap3isp: csi2: Don't dump ISP main registers drivers/media/video/isp/isp.c| 95 ++ drivers/media/video/isp/isp.h| 16 ++ drivers/media/video/isp/ispccdc.c| 42 ++- drivers/media/video/isp/ispcsi2.c|7 --- drivers/media/video/isp/isppreview.c |6 +-- drivers/media/video/isp/ispresizer.c |6 +-- 6 files changed, 119 insertions(+), 53 deletions(-) -- 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
[omap3isp RFC][PATCH v2 4/4] omap3isp: csi2: Don't dump ISP main registers
This keeps the driver focused only on accessing CSI2 registers only. if the same info is needed, isp_print_status should be called instead. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispcsi2.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/isp/ispcsi2.c b/drivers/media/video/isp/ispcsi2.c index 35e3629..13e7e22 100644 --- a/drivers/media/video/isp/ispcsi2.c +++ b/drivers/media/video/isp/ispcsi2.c @@ -611,13 +611,6 @@ void isp_csi2_regdump(struct isp_csi2_device *csi2) dev_dbg(isp->dev, "-CSI2 Register dump-\n"); - dev_dbg(isp->dev, "###ISP_CTRL=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL)); - dev_dbg(isp->dev, "###ISP_IRQ0ENABLE=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE)); - dev_dbg(isp->dev, "###ISP_IRQ0STATUS=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS)); - CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSCONFIG); CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSSTATUS); CSI2_PRINT_REGISTER(isp, csi2->regs1, IRQENABLE); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 4/4] omap3isp: csi2: Don't dump ISP main registers
This keeps the driver focused only on accessing CSI2 registers only. if the same info is needed, isp_print_status should be called instead. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispcsi2.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/isp/ispcsi2.c b/drivers/media/video/isp/ispcsi2.c index 35e3629..13e7e22 100644 --- a/drivers/media/video/isp/ispcsi2.c +++ b/drivers/media/video/isp/ispcsi2.c @@ -611,13 +611,6 @@ void isp_csi2_regdump(struct isp_csi2_device *csi2) dev_dbg(isp->dev, "-CSI2 Register dump-\n"); - dev_dbg(isp->dev, "###ISP_CTRL=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL)); - dev_dbg(isp->dev, "###ISP_IRQ0ENABLE=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE)); - dev_dbg(isp->dev, "###ISP_IRQ0STATUS=0x%x\n", - isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS)); - CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSCONFIG); CSI2_PRINT_REGISTER(isp, csi2->regs1, SYSSTATUS); CSI2_PRINT_REGISTER(isp, csi2->regs1, IRQENABLE); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 2/4] omap3isp: Move CCDC LSC prefetch wait to main isp code
Since this sequence strictly touches ISP global registers, it's not really part of the same register address space than the CCDC. Do this check in main isp code instead. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 24 drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 26 +- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 2e5030f..ee45eb6 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -339,6 +339,30 @@ void isphist_dma_done(struct isp_device *isp) } } +int ispccdc_lsc_wait_prefetch(struct isp_device *isp) +{ + unsigned int wait; + + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + + /* timeout 1 ms */ + for (wait = 0; wait < 1000; wait++) { + if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & + IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { + isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, + OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); + return 0; + } + + rmb(); + udelay(1); + } + + return -ETIMEDOUT; +} + + static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { static const char *name[] = { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index 1260e9f..d0b7b0f 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -280,6 +280,8 @@ struct isp_device { void isphist_dma_done(struct isp_device *isp); +int ispccdc_lsc_wait_prefetch(struct isp_device *isp); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 4244edf..b039bce 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -223,30 +223,6 @@ static void ispccdc_lsc_setup_regs(struct isp_ccdc_device *ccdc, ISPCCDC_LSC_INITIAL); } -static int ispccdc_lsc_wait_prefetch(struct isp_ccdc_device *ccdc) -{ - struct isp_device *isp = to_isp_device(ccdc); - unsigned int wait; - - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - - /* timeout 1 ms */ - for (wait = 0; wait < 1000; wait++) { - if (isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS) & - IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ) { - isp_reg_writel(isp, IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ, - OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); - return 0; - } - - rmb(); - udelay(1); - } - - return -ETIMEDOUT; -} - /* * __ispccdc_lsc_enable - Enables/Disables the Lens Shading Compensation module. * @ccdc: Pointer to ISP CCDC device. @@ -272,7 +248,7 @@ static int __ispccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable) ISPCCDC_LSC_ENABLE, enable ? ISPCCDC_LSC_ENABLE : 0); if (enable) { - if (ispccdc_lsc_wait_prefetch(ccdc) < 0) { + if (ispccdc_lsc_wait_prefetch(isp) < 0) { isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG, ISPCCDC_LSC_ENABLE); ccdc->lsc.state = LSC_STATE_STOPPED; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 0/4] Improve inter subdev interaction
Hi, These are some patches to make these operations more generic: - Clock control is being controlled in a very crude manner by subdevices, it should be centralized in isp.c. - LSC prefetch wait check is reading a main ISP register, so move it to isp.c - Abstract SBL busy check: we don't want a submodule thinkering with main ISP registers. That should be done in the main isp.c Also, remove main ISP register dump from CSI2 specific dump. We should be using isp_print_status if we'll like to know main ISP regdump. Comments are welcome. More cleanups for better subdevice isolation are on the way. Regards, Sergio Sergio Aguirre (4): omap3isp: Abstract isp subdevs clock control omap3isp: Move CCDC LSC prefetch wait to main isp code omap3isp: sbl: Abstract SBL busy check omap3isp: csi2: Don't dump ISP main registers drivers/media/video/isp/isp.c| 95 ++ drivers/media/video/isp/isp.h| 16 ++ drivers/media/video/isp/ispccdc.c| 42 ++- drivers/media/video/isp/ispcsi2.c|7 --- drivers/media/video/isp/isppreview.c |6 +-- drivers/media/video/isp/ispresizer.c |6 +-- 6 files changed, 119 insertions(+), 53 deletions(-) -- 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
[omap3isp RFC][PATCH 1/4] omap3isp: Abstract isp subdevs clock control
Submodules shouldn't be aware of global register bit structure, specially if the submodules are shared in the future with other TI architectures (Davinci, future OMAPs, etc) Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c| 54 ++ drivers/media/video/isp/isp.h| 12 +++ drivers/media/video/isp/ispccdc.c|6 +-- drivers/media/video/isp/isppreview.c |6 +-- drivers/media/video/isp/ispresizer.c |6 +-- 5 files changed, 72 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index 30bdc48..2e5030f 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -991,6 +991,60 @@ void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res) * Clock management */ +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res) +{ + u32 clk = 0; + + isp->subclk_resources |= res; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A) + clk |= ISPCTRL_H3A_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST) + clk |= ISPCTRL_HIST_CLK_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER) + clk |= ISPCTRL_RSZ_CLK_EN; + + /* NOTE: For CCDC & Preview submodules, we need to affect internal +* RAM aswell. +*/ + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC) + clk |= ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN; + + if (isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW) + clk |= ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN; + + isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, clk); +} + +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res) +{ + u32 clk = 0; + + isp->subclk_resources &= ~res; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_H3A)) + clk |= ISPCTRL_H3A_CLK_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_HIST)) + clk |= ISPCTRL_HIST_CLK_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_RESIZER)) + clk |= ISPCTRL_RSZ_CLK_EN; + + /* NOTE: For CCDC & Preview submodules, we need to affect internal +* RAM aswell. +*/ + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_CCDC)) + clk |= ISPCTRL_CCDC_CLK_EN | ISPCTRL_CCDC_RAM_EN; + + if (!(isp->subclk_resources & OMAP3_ISP_SUBCLK_PREVIEW)) + clk |= ISPCTRL_PREV_CLK_EN | ISPCTRL_PREV_RAM_EN; + + isp_reg_clr(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, clk); +} + /* * isp_enable_clocks - Enable ISP clocks * @isp: OMAP3 ISP device diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index b8f63e2..1260e9f 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -85,6 +85,14 @@ enum isp_sbl_resource { OMAP3_ISP_SBL_RESIZER_WRITE = 0x200, }; +enum isp_subclk_resource { + OMAP3_ISP_SUBCLK_CCDC = 0x1, + OMAP3_ISP_SUBCLK_H3A= 0x2, + OMAP3_ISP_SUBCLK_HIST = 0x4, + OMAP3_ISP_SUBCLK_PREVIEW= 0x8, + OMAP3_ISP_SUBCLK_RESIZER= 0x10, +}; + enum isp_interface_type { ISP_INTERFACE_PARALLEL, ISP_INTERFACE_CSI2A_PHY2, @@ -262,6 +270,7 @@ struct isp_device { struct isp_csiphy isp_csiphy2; unsigned int sbl_resources; + unsigned int subclk_resources; struct iommu *iommu; }; @@ -294,6 +303,9 @@ void isp_print_status(struct isp_device *isp); void isp_sbl_enable(struct isp_device *isp, enum isp_sbl_resource res); void isp_sbl_disable(struct isp_device *isp, enum isp_sbl_resource res); +void isp_subclk_enable(struct isp_device *isp, enum isp_subclk_resource res); +void isp_subclk_disable(struct isp_device *isp, enum isp_subclk_resource res); + int omap3isp_register_entities(struct platform_device *pdev, struct v4l2_device *v4l2_dev); void omap3isp_unregister_entities(struct platform_device *pdev); diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index c3d1d7a..4244edf 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1687,8 +1687,7 @@ static int ccdc_set_stream(struct v4l2_subdev *sd, int enable) if (enable == ISP_PIPELINE_STREAM_STOPPED) return 0; - isp_reg_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, - ISPCTRL_CCDC_RAM_EN | ISPCTRL_CCDC_CLK_EN); + isp_subclk_enable(isp, OMAP3_ISP_SUBCLK_CCDC); isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_VDLC); @@ -1725,8 +1724,7 @@ static int ccdc_set_stream(struct v4l2_subdev *s
[omap3isp RFC][PATCH 3/4] omap3isp: sbl: Abstract SBL busy check
Make a nicer interface that can be used by anyone accessing the isp. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 17 + drivers/media/video/isp/isp.h |2 ++ drivers/media/video/isp/ispccdc.c | 10 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index ee45eb6..9db2145 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -362,6 +362,23 @@ int ispccdc_lsc_wait_prefetch(struct isp_device *isp) return -ETIMEDOUT; } +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res) +{ + int ret = 0; + + if (res & OMAP3_ISP_SBL_CCDC_WRITE) { + ret |= (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & + ISPSBL_CCDC_WR_0_DATA_READY) +| (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & + ISPSBL_CCDC_WR_0_DATA_READY); + } + + return ret; +} static inline void isp_isr_dbg(struct isp_device *isp, u32 irqstatus) { diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index d0b7b0f..1948e23 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -282,6 +282,8 @@ void isphist_dma_done(struct isp_device *isp); int ispccdc_lsc_wait_prefetch(struct isp_device *isp); +int isp_sbl_busy(struct isp_device *isp, enum isp_sbl_resource res); + void isp_flush(struct isp_device *isp); int isp_pipeline_set_stream(struct isp_pipeline *pipe, diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index b039bce..9220d09 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1217,15 +1217,7 @@ static int ispccdc_sbl_busy(struct isp_ccdc_device *ccdc) { struct isp_device *isp = to_isp_device(ccdc); - return ispccdc_busy(ccdc) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) & - ISPSBL_CCDC_WR_0_DATA_READY) - | (isp_reg_readl(isp, OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) & - ISPSBL_CCDC_WR_0_DATA_READY); + return ispccdc_busy(ccdc) | isp_sbl_busy(isp, OMAP3_ISP_SBL_CCDC_WRITE); } /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 6/9] omap3isp: Remove CSIA/B register abstraction
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c |8 drivers/media/video/isp/ispccp2.c |2 +- drivers/media/video/isp/ispreg.h |3 --- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index f266e7c..de9352b 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -264,12 +264,12 @@ static void isp_power_settings(struct isp_device *isp, int idle) (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISP_CSIA_SYSCONFIG); + ISPCSI2_SYSCONFIG); isp_reg_writel(isp, ISPCSI1_AUTOIDLE | (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CCP2, - ISP_CSIB_SYSCONFIG); + ISPCCP2_SYSCONFIG); } isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL); @@ -284,13 +284,13 @@ static void isp_power_settings(struct isp_device *isp, int idle) (ISPCSI1_MIDLEMODE_FORCESTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISP_CSIA_SYSCONFIG); + ISPCSI2_SYSCONFIG); isp_reg_writel(isp, ISPCSI1_AUTOIDLE | (ISPCSI1_MIDLEMODE_FORCESTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CCP2, - ISP_CSIB_SYSCONFIG); + ISPCCP2_SYSCONFIG); } isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, diff --git a/drivers/media/video/isp/ispccp2.c b/drivers/media/video/isp/ispccp2.c index 45506a7..fa23394 100644 --- a/drivers/media/video/isp/ispccp2.c +++ b/drivers/media/video/isp/ispccp2.c @@ -421,7 +421,7 @@ static void ispccp2_mem_configure(struct isp_ccp2_device *ccp2, isp_reg_writel(isp, (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, ISP_CSIB_SYSCONFIG); + OMAP3_ISP_IOMEM_CCP2, ISPCCP2_SYSCONFIG); /* Hsize, Skip */ isp_reg_writel(isp, ISPCCP2_LCM_HSIZE_SKIP_MIN | diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index c080980..d885541 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -236,9 +236,6 @@ #define ISPCCP2_LCM_DST_ADDR (0x1E8) #define ISPCCP2_LCM_DST_OFST (0x1EC) -#define ISP_CSIB_SYSCONFIG ISPCCP2_SYSCONFIG -#define ISP_CSIA_SYSCONFIG ISPCSI2_SYSCONFIG - /* CCDC module register offset */ #define ISPCCDC_PID(0x000) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 3/9] omap3isp: Export isp_user.h to userspace as omap3isp.h
Signed-off-by: Sergio Aguirre --- arch/arm/plat-omap/include/mach/isp_user.h | 636 drivers/media/video/isp/ispccdc.h |2 +- drivers/media/video/isp/isph3a.h |2 +- drivers/media/video/isp/isphist.h |2 +- drivers/media/video/isp/isppreview.h |2 +- drivers/media/video/isp/ispstat.h |2 +- include/linux/Kbuild |1 + include/linux/omap3isp.h | 636 8 files changed, 642 insertions(+), 641 deletions(-) delete mode 100644 arch/arm/plat-omap/include/mach/isp_user.h create mode 100644 include/linux/omap3isp.h diff --git a/arch/arm/plat-omap/include/mach/isp_user.h b/arch/arm/plat-omap/include/mach/isp_user.h deleted file mode 100644 index dd9ccf6..000 --- a/arch/arm/plat-omap/include/mach/isp_user.h +++ /dev/null @@ -1,636 +0,0 @@ -/* - * isp_user.h - * - * TI OMAP3 ISP - User-space API - * - * Copyright (C) 2010 Nokia Corporation - * Copyright (C) 2009 Texas Instruments, Inc. - * - * Contacts: Laurent Pinchart - * Sakari Ailus - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OMAP3_ISP_USER_H -#define OMAP3_ISP_USER_H - -#include - -/* ISP Private IOCTLs */ -#define VIDIOC_PRIVATE_ISP_CCDC_CFG\ - _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct ispccdc_update_config) -#define VIDIOC_PRIVATE_ISP_PRV_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct ispprv_update_config) -#define VIDIOC_PRIVATE_ISP_AEWB_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct isph3a_aewb_config) -#define VIDIOC_PRIVATE_ISP_HIST_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct isphist_config) -#define VIDIOC_PRIVATE_ISP_AF_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct isph3a_af_config) -#define VIDIOC_PRIVATE_ISP_STAT_REQ \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct ispstat_data) -#define VIDIOC_PRIVATE_ISP_STAT_EN \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long) - -/* Events */ - -#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) -#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) -#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) -#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) -#define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4) - -struct ispstat_event_status { - __u32 frame_number; - __u16 config_counter; - __u8 buf_err; -}; - -/* AE/AWB related structures and flags*/ - -/* Flags for update field */ -#define REQUEST_STATISTICS (1 << 0) -#define SET_COLOR_GAINS(1 << 1) -#define SET_DIGITAL_GAIN (1 << 2) -#define SET_EXPOSURE (1 << 3) -#define SET_ANALOG_GAIN(1 << 4) - -/* H3A Range Constants */ -#define AEWB_MAX_SATURATION_LIM1023 -#define AEWB_MIN_WIN_H 2 -#define AEWB_MAX_WIN_H 256 -#define AEWB_MIN_WIN_W 6 -#define AEWB_MAX_WIN_W 256 -#define AEWB_MIN_WINVC 1 -#define AEWB_MIN_WINHC 1 -#define AEWB_MAX_WINVC 128 -#define AEWB_MAX_WINHC 36 -#define AEWB_MAX_WINSTART 4095 -#define AEWB_MIN_SUB_INC 2 -#define AEWB_MAX_SUB_INC 32 -#define AEWB_MAX_BUF_SIZE 83600 - -#define AF_IIRSH_MIN 0 -#define AF_IIRSH_MAX 4095 -#define AF_PAXEL_HORIZONTAL_COUNT_MIN 1 -#define AF_PAXEL_HORIZONTAL_COUNT_MAX 36 -#define AF_PAXEL_VERTICAL_COUNT_MIN1 -#define AF_PAXEL_VERTICAL_COUNT_MAX128 -#define AF_PAXEL_INCREMENT_MIN 2 -#define AF_PAXEL_INCREMENT_MAX 32 -#define AF_PAXEL_HEIGHT_MIN2 -#define AF_PAXEL_HEIGHT_MAX256 -#define AF_PAXEL_WIDTH_MIN 16 -#define AF_PAXEL_WIDTH_MAX 256 -#define AF_PAXEL_HZSTART_MIN 1 -#define AF_PAXEL_HZSTART_MAX 4095 -#define AF_PAXEL_VTSTART_MIN 0 -#define AF_PAXEL_VTSTART_MAX 4095 -#define AF_THRESHOLD_MAX 255 -#define AF_COEF_MAX4095 -#define AF_PAXEL_SIZE 48 -#define AF_MAX_BUF_SIZE221184 - -/** - * struct isph3a_aewb_config - AE AWB configuration reset values. - *
[omap3isp][PATCH v2 7/9] omap3isp: Cleanup isp_power_settings
1. Get rid of CSI2 / CCP2 power settings, as they are controlled in the receivers code anyways. 2. Avoid code duplication. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 49 ++--- 1 files changed, 7 insertions(+), 42 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index de9352b..30bdc48 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -254,48 +254,13 @@ EXPORT_SYMBOL(isp_set_xclk); */ static void isp_power_settings(struct isp_device *isp, int idle) { - if (idle) { - isp_reg_writel(isp, - (ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY << - ISP_SYSCONFIG_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); - if (omap_rev() == OMAP3430_REV_ES1_0) { - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISPCSI2_SYSCONFIG); - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, - ISPCCP2_SYSCONFIG); - } - isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, - ISP_CTRL); - - } else { - isp_reg_writel(isp, - (ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY << - ISP_SYSCONFIG_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); - if (omap_rev() == OMAP3430_REV_ES1_0) { - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_FORCESTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISPCSI2_SYSCONFIG); - - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_FORCESTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, - ISPCCP2_SYSCONFIG); - } - - isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, - ISP_CTRL); - } + isp_reg_writel(isp, + ((idle ? ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY : + ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY) << + ISP_SYSCONFIG_MIDLEMODE_SHIFT), + OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); + isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, + ISP_CTRL); } /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 4/9] omap3: Remove unusued CBUFF resource
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c9fc732..897ce82 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -67,11 +67,6 @@ static struct resource omap3isp_resources[] = { .flags = IORESOURCE_MEM, }, { - .start = OMAP3430_ISP_CBUFF_BASE, - .end= OMAP3430_ISP_CBUFF_END, - .flags = IORESOURCE_MEM, - }, - { .start = OMAP3430_ISP_CCP2_BASE, .end= OMAP3430_ISP_CCP2_END, .flags = IORESOURCE_MEM, -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 1/9] omap3isp: ccdc: Add support for YUV format
We were just supporting RAW10 formats, and we really support more options. Strictly speaking, CCDC needs at least to distinguish between RAW and YUV formats for proper configuration. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispccdc.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index be4581e..c3d1d7a 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -45,6 +45,8 @@ static const unsigned int ccdc_fmts[] = { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10, + V4L2_MBUS_FMT_YUYV8_1X16, + V4L2_MBUS_FMT_UYVY8_1X16, }; /* @@ -1069,6 +1071,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) isp_configure_bridge(isp, ccdc->input, pdata); ispccdc_config_sync_if(ccdc, &ccdc->syncif); + /* CCDC_PAD_SINK */ + format = &ccdc->formats[CCDC_PAD_SINK]; + syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Use the raw, unprocessed data when writing to memory. The H3A and @@ -1086,10 +1091,13 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) else syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; - isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); + if ((format->code == V4L2_MBUS_FMT_YUYV8_1X16) || + (format->code == V4L2_MBUS_FMT_UYVY8_1X16)) + syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16; + else + syn_mode &= ~ISPCCDC_SYN_MODE_INPMOD_MASK; - /* CCDC_PAD_SINK */ - format = &ccdc->formats[CCDC_PAD_SINK]; + isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Mosaic filter */ switch (format->code) { -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 9/9] omap3isp: Remove legacy MMU access regs/fields
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispreg.h | 43 -- 1 files changed, 0 insertions(+), 43 deletions(-) diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index 9b0d3ad..af4ddaa 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -72,11 +72,6 @@ OMAP3ISP_SBL_REG_OFFSET) #define OMAP3ISP_SBL_REG(offset) (OMAP3ISP_SBL_REG_BASE + (offset)) -#define OMAP3ISP_MMU_REG_OFFSET0x1400 -#define OMAP3ISP_MMU_REG_BASE (OMAP3ISP_REG_BASE +\ -OMAP3ISP_MMU_REG_OFFSET) -#define OMAP3ISP_MMU_REG(offset) (OMAP3ISP_MMU_REG_BASE + (offset)) - #define OMAP3ISP_CSI2A_REGS1_REG_OFFSET0x1800 #define OMAP3ISP_CSI2A_REGS1_REG_BASE (OMAP3ISP_REG_BASE +\ OMAP3ISP_CSI2A_REGS1_REG_OFFSET) @@ -458,26 +453,6 @@ #define ISPRSZ_VFILT3130 (0x0A4) #define ISPRSZ_YENH(0x0A8) -/* MMU module registers */ -#define ISPMMU_REVISION(0x000) -#define ISPMMU_SYSCONFIG (0x010) -#define ISPMMU_SYSSTATUS (0x014) -#define ISPMMU_IRQSTATUS (0x018) -#define ISPMMU_IRQENABLE (0x01C) -#define ISPMMU_WALKING_ST (0x040) -#define ISPMMU_CNTL(0x044) -#define ISPMMU_FAULT_AD(0x048) -#define ISPMMU_TTB (0x04C) -#define ISPMMU_LOCK(0x050) -#define ISPMMU_LD_TLB (0x054) -#define ISPMMU_CAM (0x058) -#define ISPMMU_RAM (0x05C) -#define ISPMMU_GFLUSH (0x060) -#define ISPMMU_FLUSH_ENTRY (0x064) -#define ISPMMU_READ_CAM(0x068) -#define ISPMMU_READ_RAM(0x06c) -#define ISPMMU_EMU_FAULT_AD(0x070) - #define ISP_INT_CLR0xFF113F11 #define ISPPRV_PCR_EN 1 #define ISPPRV_PCR_BUSY(1 << 1) @@ -1299,24 +1274,6 @@ #define ISPCCDC_LSC_INITIAL_Y_MASK 0x3F #define ISPCCDC_LSC_INITIAL_Y_SHIFT16 -#define ISPMMU_REVISION_REV_MINOR_MASK 0xF -#define ISPMMU_REVISION_REV_MAJOR_SHIFT0x4 - -#define IRQENABLE_MULTIHITFAULT(1<<4) -#define IRQENABLE_TWFAULT (1<<3) -#define IRQENABLE_EMUMISS (1<<2) -#define IRQENABLE_TRANSLNFAULT (1<<1) -#define IRQENABLE_TLBMISS (1) - -#define ISPMMU_MMUCNTL_MMU_EN (1<<1) -#define ISPMMU_MMUCNTL_TWL_EN (1<<2) -#define ISPMMU_MMUCNTL_EMUTLBUPDATE(1<<3) -#define ISPMMU_AUTOIDLE0x1 -#define ISPMMU_SIDLEMODE_FORCEIDLE 0 -#define ISPMMU_SIDLEMODE_NOIDLE1 -#define ISPMMU_SIDLEMODE_SMARTIDLE 2 -#define ISPMMU_SIDLEMODE_SHIFT 3 - /* - * CSI2 receiver registers (ES2.0) */ -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 5/9] omap3isp: Remove unused CBUFF register access
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c|2 -- drivers/media/video/isp/isp.h|1 - drivers/media/video/isp/ispreg.h | 25 - 3 files changed, 0 insertions(+), 28 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index a5c02ba..f266e7c 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -86,7 +86,6 @@ static const struct isp_res_mapping isp_res_maps[] = { { .isp_rev = ISP_REVISION_2_0, .map = 1 << OMAP3_ISP_IOMEM_MAIN | - 1 << OMAP3_ISP_IOMEM_CBUFF | 1 << OMAP3_ISP_IOMEM_CCP2 | 1 << OMAP3_ISP_IOMEM_CCDC | 1 << OMAP3_ISP_IOMEM_HIST | @@ -100,7 +99,6 @@ static const struct isp_res_mapping isp_res_maps[] = { { .isp_rev = ISP_REVISION_15_0, .map = 1 << OMAP3_ISP_IOMEM_MAIN | - 1 << OMAP3_ISP_IOMEM_CBUFF | 1 << OMAP3_ISP_IOMEM_CCP2 | 1 << OMAP3_ISP_IOMEM_CCDC | 1 << OMAP3_ISP_IOMEM_HIST | diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index edc029c..b8f63e2 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -56,7 +56,6 @@ enum isp_mem_resources { OMAP3_ISP_IOMEM_MAIN, - OMAP3_ISP_IOMEM_CBUFF, OMAP3_ISP_IOMEM_CCP2, OMAP3_ISP_IOMEM_CCDC, OMAP3_ISP_IOMEM_HIST, diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index 8e4324f..c080980 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -37,11 +37,6 @@ #define OMAP3ISP_REG_BASE OMAP3430_ISP_BASE #define OMAP3ISP_REG(offset) (OMAP3ISP_REG_BASE + (offset)) -#define OMAP3ISP_CBUFF_REG_OFFSET 0x0100 -#define OMAP3ISP_CBUFF_REG_BASE(OMAP3ISP_REG_BASE + \ -OMAP3ISP_CBUFF_REG_OFFSET) -#define OMAP3ISP_CBUFF_REG(offset) (OMAP3ISP_CBUFF_REG_BASE + (offset)) - #define OMAP3ISP_CCP2_REG_OFFSET 0x0400 #define OMAP3ISP_CCP2_REG_BASE (OMAP3ISP_REG_BASE +\ OMAP3ISP_CCP2_REG_OFFSET) @@ -244,26 +239,6 @@ #define ISP_CSIB_SYSCONFIG ISPCCP2_SYSCONFIG #define ISP_CSIA_SYSCONFIG ISPCSI2_SYSCONFIG -/* ISP_CBUFF Registers */ - -#define ISP_CBUFF_SYSCONFIG(0x010) -#define ISP_CBUFF_IRQENABLE(0x01C) - -#define ISP_CBUFF0_CTRL(0x020) -#define ISP_CBUFF1_CTRL(0x024) - -#define ISP_CBUFF0_START (0x040) -#define ISP_CBUFF1_START (0x044) - -#define ISP_CBUFF0_END (0x050) -#define ISP_CBUFF1_END (0x054) - -#define ISP_CBUFF0_WINDOWSIZE (0x060) -#define ISP_CBUFF1_WINDOWSIZE (0x064) - -#define ISP_CBUFF0_THRESHOLD (0x070) -#define ISP_CBUFF1_THRESHOLD (0x074) - /* CCDC module register offset */ #define ISPCCDC_PID(0x000) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 2/9] omap3: Fix camera resources for multiomap
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c | 27 --- 1 files changed, 12 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c2275d3..c9fc732 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { { .start = OMAP24XX_CAMERA_BASE, .end= OMAP24XX_CAMERA_BASE + 0xfff, @@ -50,19 +50,15 @@ static struct resource cam_resources[] = { } }; -static struct platform_device omap_cam_device = { +static struct platform_device omap2cam_device = { .name = "omap24xxcam", .id = -1, - .num_resources = ARRAY_SIZE(cam_resources), - .resource = cam_resources, + .num_resources = ARRAY_SIZE(omap2cam_resources), + .resource = omap2cam_resources, }; +#endif -static inline void omap_init_camera(void) -{ - platform_device_register(&omap_cam_device); -} - -#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) static struct resource omap3isp_resources[] = { { @@ -165,15 +161,16 @@ struct platform_device omap3isp_device = { }, }; EXPORT_SYMBOL_GPL(omap3isp_device); +#endif static inline void omap_init_camera(void) { -} -#else -static inline void omap_init_camera(void) -{ -} +#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) + if (cpu_is_omap24xx()) + platform_device_register(&omap2cam_device); #endif +} + #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp][PATCH v2 0/9] YUV support for CCDC + cleanups
Hi, First of all, these patches are based on Laurent's tree: URL: git://linuxtv.org/pinchartl/media.git Branch: media-0004-omap3isp (Commit d0c5b0e4: OMAP3 ISP driver) I had these patches in my queue for some time, which: - Add YUV support to CCDC - Cleans up platform device MEM resources - Removes some unused/legacy defines - IMPORTANT: Moves/Renames isp_user.h to include/linux/omap3isp.h I'm working on some more changes to keep register access per component a bit cleaner. But that will be sent separately in another RFC patchlist. Please share your review comments. Changelog: v2 - Squashed patches 1 & 2 of previous set ("omap3isp: ccdc: Add support for YUV format" and "omap3isp: ccdc: Write SYN_MODE.INPMOD based on fmt" respectively) v1 - Initial version (found here: http://www.spinics.net/lists/linux-media/msg25016.html) Regards, Sergio Sergio Aguirre (9): omap3isp: ccdc: Add support for YUV format omap3: Fix camera resources for multiomap omap3isp: Export isp_user.h to userspace as omap3isp.h omap3: Remove unusued CBUFF resource omap3isp: Remove unused CBUFF register access omap3isp: Remove CSIA/B register abstraction omap3isp: Cleanup isp_power_settings omap3isp: ccp2: Make SYSCONFIG fields consistent omap3isp: Remove legacy MMU access regs/fields arch/arm/mach-omap2/devices.c | 32 +- arch/arm/plat-omap/include/mach/isp_user.h | 636 drivers/media/video/isp/isp.c | 51 +-- drivers/media/video/isp/isp.h |1 - drivers/media/video/isp/ispccdc.c | 14 +- drivers/media/video/isp/ispccdc.h |2 +- drivers/media/video/isp/ispccp2.c |5 +- drivers/media/video/isp/isph3a.h |2 +- drivers/media/video/isp/isphist.h |2 +- drivers/media/video/isp/isppreview.h |2 +- drivers/media/video/isp/ispreg.h | 85 + drivers/media/video/isp/ispstat.h |2 +- include/linux/Kbuild |1 + include/linux/omap3isp.h | 636 14 files changed, 682 insertions(+), 789 deletions(-) delete mode 100644 arch/arm/plat-omap/include/mach/isp_user.h create mode 100644 include/linux/omap3isp.h -- 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
[omap3isp][PATCH v2 8/9] omap3isp: ccp2: Make SYSCONFIG fields consistent
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispccp2.c |3 +-- drivers/media/video/isp/ispreg.h | 14 -- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/isp/ispccp2.c b/drivers/media/video/isp/ispccp2.c index fa23394..3127a74 100644 --- a/drivers/media/video/isp/ispccp2.c +++ b/drivers/media/video/isp/ispccp2.c @@ -419,8 +419,7 @@ static void ispccp2_mem_configure(struct isp_ccp2_device *ccp2, config->src_ofst = 0; } - isp_reg_writel(isp, (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), + isp_reg_writel(isp, ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_SYSCONFIG); /* Hsize, Skip */ diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index d885541..9b0d3ad 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -141,6 +141,14 @@ #define ISPCCP2_REVISION (0x000) #define ISPCCP2_SYSCONFIG (0x004) #define ISPCCP2_SYSCONFIG_SOFT_RESET (1 << 1) +#define ISPCCP2_SYSCONFIG_AUTO_IDLE0x1 +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT 12 +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_FORCE \ + (0x0 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_NO \ + (0x1 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART \ + (0x2 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) #define ISPCCP2_SYSSTATUS (0x008) #define ISPCCP2_SYSSTATUS_RESET_DONE (1 << 0) #define ISPCCP2_LC01_IRQENABLE (0x00C) @@ -1309,12 +1317,6 @@ #define ISPMMU_SIDLEMODE_SMARTIDLE 2 #define ISPMMU_SIDLEMODE_SHIFT 3 -#define ISPCSI1_AUTOIDLE 0x1 -#define ISPCSI1_MIDLEMODE_SHIFT12 -#define ISPCSI1_MIDLEMODE_FORCESTANDBY 0x0 -#define ISPCSI1_MIDLEMODE_NOSTANDBY0x1 -#define ISPCSI1_MIDLEMODE_SMARTSTANDBY 0x2 - /* - * CSI2 receiver registers (ES2.0) */ -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 03/10] omap3: Fix camera resources for multiomap
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c | 27 --- 1 files changed, 12 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c2275d3..c9fc732 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -38,7 +38,7 @@ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) -static struct resource cam_resources[] = { +static struct resource omap2cam_resources[] = { { .start = OMAP24XX_CAMERA_BASE, .end= OMAP24XX_CAMERA_BASE + 0xfff, @@ -50,19 +50,15 @@ static struct resource cam_resources[] = { } }; -static struct platform_device omap_cam_device = { +static struct platform_device omap2cam_device = { .name = "omap24xxcam", .id = -1, - .num_resources = ARRAY_SIZE(cam_resources), - .resource = cam_resources, + .num_resources = ARRAY_SIZE(omap2cam_resources), + .resource = omap2cam_resources, }; +#endif -static inline void omap_init_camera(void) -{ - platform_device_register(&omap_cam_device); -} - -#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) static struct resource omap3isp_resources[] = { { @@ -165,15 +161,16 @@ struct platform_device omap3isp_device = { }, }; EXPORT_SYMBOL_GPL(omap3isp_device); +#endif static inline void omap_init_camera(void) { -} -#else -static inline void omap_init_camera(void) -{ -} +#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) + if (cpu_is_omap24xx()) + platform_device_register(&omap2cam_device); #endif +} + #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 07/10] omap3isp: Remove CSIA/B register abstraction
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c |8 drivers/media/video/isp/ispccp2.c |2 +- drivers/media/video/isp/ispreg.h |3 --- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index f266e7c..de9352b 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -264,12 +264,12 @@ static void isp_power_settings(struct isp_device *isp, int idle) (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISP_CSIA_SYSCONFIG); + ISPCSI2_SYSCONFIG); isp_reg_writel(isp, ISPCSI1_AUTOIDLE | (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CCP2, - ISP_CSIB_SYSCONFIG); + ISPCCP2_SYSCONFIG); } isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL); @@ -284,13 +284,13 @@ static void isp_power_settings(struct isp_device *isp, int idle) (ISPCSI1_MIDLEMODE_FORCESTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISP_CSIA_SYSCONFIG); + ISPCSI2_SYSCONFIG); isp_reg_writel(isp, ISPCSI1_AUTOIDLE | (ISPCSI1_MIDLEMODE_FORCESTANDBY << ISPCSI1_MIDLEMODE_SHIFT), OMAP3_ISP_IOMEM_CCP2, - ISP_CSIB_SYSCONFIG); + ISPCCP2_SYSCONFIG); } isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, diff --git a/drivers/media/video/isp/ispccp2.c b/drivers/media/video/isp/ispccp2.c index 45506a7..fa23394 100644 --- a/drivers/media/video/isp/ispccp2.c +++ b/drivers/media/video/isp/ispccp2.c @@ -421,7 +421,7 @@ static void ispccp2_mem_configure(struct isp_ccp2_device *ccp2, isp_reg_writel(isp, (ISPCSI1_MIDLEMODE_SMARTSTANDBY << ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, ISP_CSIB_SYSCONFIG); + OMAP3_ISP_IOMEM_CCP2, ISPCCP2_SYSCONFIG); /* Hsize, Skip */ isp_reg_writel(isp, ISPCCP2_LCM_HSIZE_SKIP_MIN | diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index c080980..d885541 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -236,9 +236,6 @@ #define ISPCCP2_LCM_DST_ADDR (0x1E8) #define ISPCCP2_LCM_DST_OFST (0x1EC) -#define ISP_CSIB_SYSCONFIG ISPCCP2_SYSCONFIG -#define ISP_CSIA_SYSCONFIG ISPCSI2_SYSCONFIG - /* CCDC module register offset */ #define ISPCCDC_PID(0x000) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 06/10] omap3isp: Remove unused CBUFF register access
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c|2 -- drivers/media/video/isp/isp.h|1 - drivers/media/video/isp/ispreg.h | 25 - 3 files changed, 0 insertions(+), 28 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index a5c02ba..f266e7c 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -86,7 +86,6 @@ static const struct isp_res_mapping isp_res_maps[] = { { .isp_rev = ISP_REVISION_2_0, .map = 1 << OMAP3_ISP_IOMEM_MAIN | - 1 << OMAP3_ISP_IOMEM_CBUFF | 1 << OMAP3_ISP_IOMEM_CCP2 | 1 << OMAP3_ISP_IOMEM_CCDC | 1 << OMAP3_ISP_IOMEM_HIST | @@ -100,7 +99,6 @@ static const struct isp_res_mapping isp_res_maps[] = { { .isp_rev = ISP_REVISION_15_0, .map = 1 << OMAP3_ISP_IOMEM_MAIN | - 1 << OMAP3_ISP_IOMEM_CBUFF | 1 << OMAP3_ISP_IOMEM_CCP2 | 1 << OMAP3_ISP_IOMEM_CCDC | 1 << OMAP3_ISP_IOMEM_HIST | diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h index edc029c..b8f63e2 100644 --- a/drivers/media/video/isp/isp.h +++ b/drivers/media/video/isp/isp.h @@ -56,7 +56,6 @@ enum isp_mem_resources { OMAP3_ISP_IOMEM_MAIN, - OMAP3_ISP_IOMEM_CBUFF, OMAP3_ISP_IOMEM_CCP2, OMAP3_ISP_IOMEM_CCDC, OMAP3_ISP_IOMEM_HIST, diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index 8e4324f..c080980 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -37,11 +37,6 @@ #define OMAP3ISP_REG_BASE OMAP3430_ISP_BASE #define OMAP3ISP_REG(offset) (OMAP3ISP_REG_BASE + (offset)) -#define OMAP3ISP_CBUFF_REG_OFFSET 0x0100 -#define OMAP3ISP_CBUFF_REG_BASE(OMAP3ISP_REG_BASE + \ -OMAP3ISP_CBUFF_REG_OFFSET) -#define OMAP3ISP_CBUFF_REG(offset) (OMAP3ISP_CBUFF_REG_BASE + (offset)) - #define OMAP3ISP_CCP2_REG_OFFSET 0x0400 #define OMAP3ISP_CCP2_REG_BASE (OMAP3ISP_REG_BASE +\ OMAP3ISP_CCP2_REG_OFFSET) @@ -244,26 +239,6 @@ #define ISP_CSIB_SYSCONFIG ISPCCP2_SYSCONFIG #define ISP_CSIA_SYSCONFIG ISPCSI2_SYSCONFIG -/* ISP_CBUFF Registers */ - -#define ISP_CBUFF_SYSCONFIG(0x010) -#define ISP_CBUFF_IRQENABLE(0x01C) - -#define ISP_CBUFF0_CTRL(0x020) -#define ISP_CBUFF1_CTRL(0x024) - -#define ISP_CBUFF0_START (0x040) -#define ISP_CBUFF1_START (0x044) - -#define ISP_CBUFF0_END (0x050) -#define ISP_CBUFF1_END (0x054) - -#define ISP_CBUFF0_WINDOWSIZE (0x060) -#define ISP_CBUFF1_WINDOWSIZE (0x064) - -#define ISP_CBUFF0_THRESHOLD (0x070) -#define ISP_CBUFF1_THRESHOLD (0x074) - /* CCDC module register offset */ #define ISPCCDC_PID(0x000) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 02/10] omap3isp: ccdc: Write SYN_MODE.INPMOD based on fmt
This takes into account the input format to select the adequate configuration for SYNC mode. Also, change bitmask ISPCCDC_SYN_MODE_INPMOD_MASK to be more consistent with other bitmasks. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispccdc.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index bee2bbe..c3d1d7a 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -1071,6 +1071,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) isp_configure_bridge(isp, ccdc->input, pdata); ispccdc_config_sync_if(ccdc, &ccdc->syncif); + /* CCDC_PAD_SINK */ + format = &ccdc->formats[CCDC_PAD_SINK]; + syn_mode = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Use the raw, unprocessed data when writing to memory. The H3A and @@ -1088,10 +1091,13 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) else syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ; - isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); + if ((format->code == V4L2_MBUS_FMT_YUYV8_1X16) || + (format->code == V4L2_MBUS_FMT_UYVY8_1X16)) + syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16; + else + syn_mode &= ~ISPCCDC_SYN_MODE_INPMOD_MASK; - /* CCDC_PAD_SINK */ - format = &ccdc->formats[CCDC_PAD_SINK]; + isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); /* Mosaic filter */ switch (format->code) { -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 04/10] omap3isp: Export isp_user.h to userspace as omap3isp.h
Signed-off-by: Sergio Aguirre --- arch/arm/plat-omap/include/mach/isp_user.h | 636 drivers/media/video/isp/ispccdc.h |2 +- drivers/media/video/isp/isph3a.h |2 +- drivers/media/video/isp/isphist.h |2 +- drivers/media/video/isp/isppreview.h |2 +- drivers/media/video/isp/ispstat.h |2 +- include/linux/Kbuild |1 + include/linux/omap3isp.h | 636 8 files changed, 642 insertions(+), 641 deletions(-) delete mode 100644 arch/arm/plat-omap/include/mach/isp_user.h create mode 100644 include/linux/omap3isp.h diff --git a/arch/arm/plat-omap/include/mach/isp_user.h b/arch/arm/plat-omap/include/mach/isp_user.h deleted file mode 100644 index dd9ccf6..000 --- a/arch/arm/plat-omap/include/mach/isp_user.h +++ /dev/null @@ -1,636 +0,0 @@ -/* - * isp_user.h - * - * TI OMAP3 ISP - User-space API - * - * Copyright (C) 2010 Nokia Corporation - * Copyright (C) 2009 Texas Instruments, Inc. - * - * Contacts: Laurent Pinchart - * Sakari Ailus - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OMAP3_ISP_USER_H -#define OMAP3_ISP_USER_H - -#include - -/* ISP Private IOCTLs */ -#define VIDIOC_PRIVATE_ISP_CCDC_CFG\ - _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct ispccdc_update_config) -#define VIDIOC_PRIVATE_ISP_PRV_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct ispprv_update_config) -#define VIDIOC_PRIVATE_ISP_AEWB_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct isph3a_aewb_config) -#define VIDIOC_PRIVATE_ISP_HIST_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct isphist_config) -#define VIDIOC_PRIVATE_ISP_AF_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct isph3a_af_config) -#define VIDIOC_PRIVATE_ISP_STAT_REQ \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct ispstat_data) -#define VIDIOC_PRIVATE_ISP_STAT_EN \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long) - -/* Events */ - -#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) -#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) -#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) -#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) -#define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4) - -struct ispstat_event_status { - __u32 frame_number; - __u16 config_counter; - __u8 buf_err; -}; - -/* AE/AWB related structures and flags*/ - -/* Flags for update field */ -#define REQUEST_STATISTICS (1 << 0) -#define SET_COLOR_GAINS(1 << 1) -#define SET_DIGITAL_GAIN (1 << 2) -#define SET_EXPOSURE (1 << 3) -#define SET_ANALOG_GAIN(1 << 4) - -/* H3A Range Constants */ -#define AEWB_MAX_SATURATION_LIM1023 -#define AEWB_MIN_WIN_H 2 -#define AEWB_MAX_WIN_H 256 -#define AEWB_MIN_WIN_W 6 -#define AEWB_MAX_WIN_W 256 -#define AEWB_MIN_WINVC 1 -#define AEWB_MIN_WINHC 1 -#define AEWB_MAX_WINVC 128 -#define AEWB_MAX_WINHC 36 -#define AEWB_MAX_WINSTART 4095 -#define AEWB_MIN_SUB_INC 2 -#define AEWB_MAX_SUB_INC 32 -#define AEWB_MAX_BUF_SIZE 83600 - -#define AF_IIRSH_MIN 0 -#define AF_IIRSH_MAX 4095 -#define AF_PAXEL_HORIZONTAL_COUNT_MIN 1 -#define AF_PAXEL_HORIZONTAL_COUNT_MAX 36 -#define AF_PAXEL_VERTICAL_COUNT_MIN1 -#define AF_PAXEL_VERTICAL_COUNT_MAX128 -#define AF_PAXEL_INCREMENT_MIN 2 -#define AF_PAXEL_INCREMENT_MAX 32 -#define AF_PAXEL_HEIGHT_MIN2 -#define AF_PAXEL_HEIGHT_MAX256 -#define AF_PAXEL_WIDTH_MIN 16 -#define AF_PAXEL_WIDTH_MAX 256 -#define AF_PAXEL_HZSTART_MIN 1 -#define AF_PAXEL_HZSTART_MAX 4095 -#define AF_PAXEL_VTSTART_MIN 0 -#define AF_PAXEL_VTSTART_MAX 4095 -#define AF_THRESHOLD_MAX 255 -#define AF_COEF_MAX4095 -#define AF_PAXEL_SIZE 48 -#define AF_MAX_BUF_SIZE221184 - -/** - * struct isph3a_aewb_config - AE AWB configuration reset values. - *
[omap3isp RFC][PATCH 08/10] omap3isp: Cleanup isp_power_settings
1. Get rid of CSI2 / CCP2 power settings, as they are controlled in the receivers code anyways. 2. Avoid code duplication. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/isp.c | 49 ++--- 1 files changed, 7 insertions(+), 42 deletions(-) diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c index de9352b..30bdc48 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c @@ -254,48 +254,13 @@ EXPORT_SYMBOL(isp_set_xclk); */ static void isp_power_settings(struct isp_device *isp, int idle) { - if (idle) { - isp_reg_writel(isp, - (ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY << - ISP_SYSCONFIG_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); - if (omap_rev() == OMAP3430_REV_ES1_0) { - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISPCSI2_SYSCONFIG); - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, - ISPCCP2_SYSCONFIG); - } - isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, - ISP_CTRL); - - } else { - isp_reg_writel(isp, - (ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY << - ISP_SYSCONFIG_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); - if (omap_rev() == OMAP3430_REV_ES1_0) { - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_FORCESTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CSI2A_REGS1, - ISPCSI2_SYSCONFIG); - - isp_reg_writel(isp, ISPCSI1_AUTOIDLE | - (ISPCSI1_MIDLEMODE_FORCESTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), - OMAP3_ISP_IOMEM_CCP2, - ISPCCP2_SYSCONFIG); - } - - isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, - ISP_CTRL); - } + isp_reg_writel(isp, + ((idle ? ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY : + ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY) << + ISP_SYSCONFIG_MIDLEMODE_SHIFT), + OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG); + isp_reg_writel(isp, ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN, + ISP_CTRL); } /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 01/10] omap3isp: ccdc: Add support for YUV format
We were just supporting RAW10 formats, and we really support more options. Strictly speaking, CCDC needs at least to distinguish between RAW and YUV formats for proper configuration. Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispccdc.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index be4581e..bee2bbe 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -45,6 +45,8 @@ static const unsigned int ccdc_fmts[] = { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10, + V4L2_MBUS_FMT_YUYV8_1X16, + V4L2_MBUS_FMT_UYVY8_1X16, }; /* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 05/10] omap3: Remove unusued CBUFF resource
Signed-off-by: Sergio Aguirre --- arch/arm/mach-omap2/devices.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c9fc732..897ce82 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -67,11 +67,6 @@ static struct resource omap3isp_resources[] = { .flags = IORESOURCE_MEM, }, { - .start = OMAP3430_ISP_CBUFF_BASE, - .end= OMAP3430_ISP_CBUFF_END, - .flags = IORESOURCE_MEM, - }, - { .start = OMAP3430_ISP_CCP2_BASE, .end= OMAP3430_ISP_CCP2_END, .flags = IORESOURCE_MEM, -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 09/10] omap3isp: ccp2: Make SYSCONFIG fields consistent
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispccp2.c |3 +-- drivers/media/video/isp/ispreg.h | 14 -- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/isp/ispccp2.c b/drivers/media/video/isp/ispccp2.c index fa23394..3127a74 100644 --- a/drivers/media/video/isp/ispccp2.c +++ b/drivers/media/video/isp/ispccp2.c @@ -419,8 +419,7 @@ static void ispccp2_mem_configure(struct isp_ccp2_device *ccp2, config->src_ofst = 0; } - isp_reg_writel(isp, (ISPCSI1_MIDLEMODE_SMARTSTANDBY << - ISPCSI1_MIDLEMODE_SHIFT), + isp_reg_writel(isp, ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART, OMAP3_ISP_IOMEM_CCP2, ISPCCP2_SYSCONFIG); /* Hsize, Skip */ diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index d885541..9b0d3ad 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -141,6 +141,14 @@ #define ISPCCP2_REVISION (0x000) #define ISPCCP2_SYSCONFIG (0x004) #define ISPCCP2_SYSCONFIG_SOFT_RESET (1 << 1) +#define ISPCCP2_SYSCONFIG_AUTO_IDLE0x1 +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT 12 +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_FORCE \ + (0x0 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_NO \ + (0x1 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) +#define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART \ + (0x2 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT) #define ISPCCP2_SYSSTATUS (0x008) #define ISPCCP2_SYSSTATUS_RESET_DONE (1 << 0) #define ISPCCP2_LC01_IRQENABLE (0x00C) @@ -1309,12 +1317,6 @@ #define ISPMMU_SIDLEMODE_SMARTIDLE 2 #define ISPMMU_SIDLEMODE_SHIFT 3 -#define ISPCSI1_AUTOIDLE 0x1 -#define ISPCSI1_MIDLEMODE_SHIFT12 -#define ISPCSI1_MIDLEMODE_FORCESTANDBY 0x0 -#define ISPCSI1_MIDLEMODE_NOSTANDBY0x1 -#define ISPCSI1_MIDLEMODE_SMARTSTANDBY 0x2 - /* - * CSI2 receiver registers (ES2.0) */ -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 10/10] omap3isp: Remove legacy MMU access regs/fields
Signed-off-by: Sergio Aguirre --- drivers/media/video/isp/ispreg.h | 43 -- 1 files changed, 0 insertions(+), 43 deletions(-) diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h index 9b0d3ad..af4ddaa 100644 --- a/drivers/media/video/isp/ispreg.h +++ b/drivers/media/video/isp/ispreg.h @@ -72,11 +72,6 @@ OMAP3ISP_SBL_REG_OFFSET) #define OMAP3ISP_SBL_REG(offset) (OMAP3ISP_SBL_REG_BASE + (offset)) -#define OMAP3ISP_MMU_REG_OFFSET0x1400 -#define OMAP3ISP_MMU_REG_BASE (OMAP3ISP_REG_BASE +\ -OMAP3ISP_MMU_REG_OFFSET) -#define OMAP3ISP_MMU_REG(offset) (OMAP3ISP_MMU_REG_BASE + (offset)) - #define OMAP3ISP_CSI2A_REGS1_REG_OFFSET0x1800 #define OMAP3ISP_CSI2A_REGS1_REG_BASE (OMAP3ISP_REG_BASE +\ OMAP3ISP_CSI2A_REGS1_REG_OFFSET) @@ -458,26 +453,6 @@ #define ISPRSZ_VFILT3130 (0x0A4) #define ISPRSZ_YENH(0x0A8) -/* MMU module registers */ -#define ISPMMU_REVISION(0x000) -#define ISPMMU_SYSCONFIG (0x010) -#define ISPMMU_SYSSTATUS (0x014) -#define ISPMMU_IRQSTATUS (0x018) -#define ISPMMU_IRQENABLE (0x01C) -#define ISPMMU_WALKING_ST (0x040) -#define ISPMMU_CNTL(0x044) -#define ISPMMU_FAULT_AD(0x048) -#define ISPMMU_TTB (0x04C) -#define ISPMMU_LOCK(0x050) -#define ISPMMU_LD_TLB (0x054) -#define ISPMMU_CAM (0x058) -#define ISPMMU_RAM (0x05C) -#define ISPMMU_GFLUSH (0x060) -#define ISPMMU_FLUSH_ENTRY (0x064) -#define ISPMMU_READ_CAM(0x068) -#define ISPMMU_READ_RAM(0x06c) -#define ISPMMU_EMU_FAULT_AD(0x070) - #define ISP_INT_CLR0xFF113F11 #define ISPPRV_PCR_EN 1 #define ISPPRV_PCR_BUSY(1 << 1) @@ -1299,24 +1274,6 @@ #define ISPCCDC_LSC_INITIAL_Y_MASK 0x3F #define ISPCCDC_LSC_INITIAL_Y_SHIFT16 -#define ISPMMU_REVISION_REV_MINOR_MASK 0xF -#define ISPMMU_REVISION_REV_MAJOR_SHIFT0x4 - -#define IRQENABLE_MULTIHITFAULT(1<<4) -#define IRQENABLE_TWFAULT (1<<3) -#define IRQENABLE_EMUMISS (1<<2) -#define IRQENABLE_TRANSLNFAULT (1<<1) -#define IRQENABLE_TLBMISS (1) - -#define ISPMMU_MMUCNTL_MMU_EN (1<<1) -#define ISPMMU_MMUCNTL_TWL_EN (1<<2) -#define ISPMMU_MMUCNTL_EMUTLBUPDATE(1<<3) -#define ISPMMU_AUTOIDLE0x1 -#define ISPMMU_SIDLEMODE_FORCEIDLE 0 -#define ISPMMU_SIDLEMODE_NOIDLE1 -#define ISPMMU_SIDLEMODE_SMARTIDLE 2 -#define ISPMMU_SIDLEMODE_SHIFT 3 - /* - * CSI2 receiver registers (ES2.0) */ -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[omap3isp RFC][PATCH 00/10] YUV support for CCDC + cleanups
Hi, First of all, these patches are based on Laurent's tree: URL: git://linuxtv.org/pinchartl/media.git Branch: media-0004-omap3isp (Commit d0c5b0e4: OMAP3 ISP driver) I had these patches in my queue for some time, which: - Add YUV support to CCDC - Cleans up platform device MEM resources - Removes some unused/legacy defines - IMPORTANT: Moves/Renames isp_user.h to include/linux/omap3isp.h I'm working on some more changes to keep register access per component a bit cleaner. But that will be sent separately in another RFC patchlist. Please share your review comments. Regards, Sergio Sergio Aguirre (10): omap3isp: ccdc: Add support for YUV format omap3isp: ccdc: Write SYN_MODE.INPMOD based on fmt omap3: Fix camera resources for multiomap omap3isp: Export isp_user.h to userspace as omap3isp.h omap3: Remove unusued CBUFF resource omap3isp: Remove unused CBUFF register access omap3isp: Remove CSIA/B register abstraction omap3isp: Cleanup isp_power_settings omap3isp: ccp2: Make SYSCONFIG fields consistent omap3isp: Remove legacy MMU access regs/fields arch/arm/mach-omap2/devices.c | 32 +- arch/arm/plat-omap/include/mach/isp_user.h | 636 drivers/media/video/isp/isp.c | 51 +-- drivers/media/video/isp/isp.h |1 - drivers/media/video/isp/ispccdc.c | 14 +- drivers/media/video/isp/ispccdc.h |2 +- drivers/media/video/isp/ispccp2.c |5 +- drivers/media/video/isp/isph3a.h |2 +- drivers/media/video/isp/isphist.h |2 +- drivers/media/video/isp/isppreview.h |2 +- drivers/media/video/isp/ispreg.h | 85 + drivers/media/video/isp/ispstat.h |2 +- include/linux/Kbuild |1 + include/linux/omap3isp.h | 636 14 files changed, 682 insertions(+), 789 deletions(-) delete mode 100644 arch/arm/plat-omap/include/mach/isp_user.h create mode 100644 include/linux/omap3isp.h -- 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
[media-ctl PATCH 2/3] Just include kernel headers
We shouldn't require full kernel source for this. Signed-off-by: Sergio Aguirre --- Makefile |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bf4cf55..300ed7e 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,9 @@ -SRCARCH ?= arm CROSS_COMPILE ?= arm-none-linux-gnueabi- -KDIR ?= /usr/src/linux +HDIR ?= /usr/include -KINC := -I$(KDIR)/include -I$(KDIR)/arch/$(SRCARCH)/include CC := $(CROSS_COMPILE)gcc -CFLAGS = -O2 -Wall -fpic -I. $(KINC) +CFLAGS = -O2 -Wall -fpic -I$(HDIR) OBJS = media.o main.o options.o subdev.o all: media-ctl -- 1.6.3.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
[media-ctl PATCH 0/3] Some patches for MC testapp
Hi Laurent, Here's some patches I have generated when trying to use your app with my Zoom3 board/environment. These are based on your git tree: http://git.ideasonboard.org/?p=media-ctl.git;a=summary Your comments are appreciated. Regards, Sergio Sergio Aguirre (3): Create initial .gitignore file Just include kernel headers Be able to add more CFLAGS .gitignore |4 Makefile |6 ++ 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .gitignore -- 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
[media-ctl PATCH 3/3] Be able to add more CFLAGS
This allows the gcc compilation to build with extra parameters. For example, if we want to build with -static, we just do: make CFLAGS=-static Signed-off-by: Sergio Aguirre --- Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 300ed7e..bd53626 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ HDIR ?= /usr/include CC := $(CROSS_COMPILE)gcc -CFLAGS = -O2 -Wall -fpic -I$(HDIR) +CFLAGS += -O2 -Wall -fpic -I$(HDIR) OBJS = media.o main.o options.o subdev.o all: media-ctl -- 1.6.3.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
[media-ctl PATCH 1/3] Create initial .gitignore file
The idea of this file is to ignore build generated files, and also the "standard" patches subfolder, used by quilt for example. Signed-off-by: Sergio Aguirre --- .gitignore |4 1 files changed, 4 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..1e56cf5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +media-ctl + +patches/* -- 1.6.3.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
[RFC][PATCH 2/2] v4l2: Add lv8093 lens driver
This adds LV8093 Piezo Actuator Lens driver. This is currently found in tandem with IMX046 sensor. Signed-off-by: Sergio Aguirre --- drivers/media/video/Kconfig |8 + drivers/media/video/Makefile |1 + drivers/media/video/lv8093.c | 614 + drivers/media/video/lv8093_regs.h | 76 + include/media/lv8093.h| 40 +++ include/media/v4l2-chip-ident.h |3 + 6 files changed, 742 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/lv8093.c create mode 100644 drivers/media/video/lv8093_regs.h create mode 100644 include/media/lv8093.h diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 10cd7b3..b62adce 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -344,6 +344,14 @@ config VIDEO_IMX046 IMX046 camera. It is currently working with the TI OMAP3 camera controller. +config VIDEO_LV8093 + tristate "Piezo Actuator Lens driver for LV8093" + depends on I2C && VIDEO_V4L2 + ---help--- + This is a Video4Linux2 lens driver for the Sanyo LV8093. + It is currently working with the TI OMAP3 camera controller + and Sony IMX046 sensor. + config VIDEO_SAA7110 tristate "Philips SAA7110 video decoder" depends on VIDEO_V4L2 && I2C diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index 00341cb..50f528c 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_VIDEO_TDA9840) += tda9840.o obj-$(CONFIG_VIDEO_TEA6415C) += tea6415c.o obj-$(CONFIG_VIDEO_TEA6420) += tea6420.o obj-$(CONFIG_VIDEO_IMX046) += imx046.o +obj-$(CONFIG_VIDEO_LV8093) += lv8093.o obj-$(CONFIG_VIDEO_SAA7110) += saa7110.o obj-$(CONFIG_VIDEO_SAA711X) += saa7115.o obj-$(CONFIG_VIDEO_SAA717X) += saa717x.o diff --git a/drivers/media/video/lv8093.c b/drivers/media/video/lv8093.c new file mode 100644 index 000..b0b0fcf --- /dev/null +++ b/drivers/media/video/lv8093.c @@ -0,0 +1,614 @@ +/* + * drivers/media/video/lv8093.c + * + * LV8093 Piezo Motor (LENS) driver + * + * Copyright (C) 2008-2009 Texas Instruments. + * Copyright (C) 2009 Hewlett-Packard. + * + * This package is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "lv8093_regs.h" + +static struct vcontrol { + struct v4l2_queryctrl qc; +} video_control[] = { + { + { + .id = V4L2_CID_FOCUS_RELATIVE, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Lens Relative Position", + .minimum = 0, + .maximum = 0, + .step = LV8093_MAX_RELATIVE_STEP, + .default_value = 0, + } + ,} +}; + +static struct i2c_driver lv8093_i2c_driver; + +static struct lv8093_lens_settings { + u8 reg; + u8 val; +} lens_settings[] = { + { /* Set control register */ + .reg = CAMAF_LV8093_CTL_REG, + .val = CAMAF_LV8093_GATE0 | + CAMAF_LV8093_ENIN | + CAMAF_LV8093_CKSEL_ONE | + CAMAF_LV8093_RET2 | + CAMAF_LV8093_INIT_OFF, + }, + { /* Specify number of clocks per period */ + .reg = CAMAF_LV8093_RST_REG, + .val = (LV8093_CLK_PER_PERIOD - 1), + }, + { /* Set the GATE_A pulse set value */ + .reg = CAMAF_LV8093_GTAS_REG, + .val = (LV8093_TIME_GATEA + 1), + }, + { /* Set the GATE_B pulse reset value */ + .reg = CAMAF_LV8093_GTBR_REG, + .val = (LV8093_TIME_GATEA + 1 + LV8093_TIME_OFF), + }, + { /* Set the GATE_B pulse set value */ + .reg = CAMAF_LV8093_GTBS_REG, + .val = (LV8093_TIME_GATEA + 1 + + LV8093_TIME_OFF + LV8093_TIME_GATEB), + }, + { /* Specific the number of output pulse steps */ + .reg = CAMAF_LV8093_STP_REG, + .val = LV8093_STP, + }, + { /* Set the number of swing back of init sequence performed */ + .reg = CAMAF_LV8093_MOV_REG, + .val = 0, + }, +}; + +/** + * find_vctrl - Finds the requested ID in the video control structure array + * @id: ID of control to search the video control array for + * +
[media-ctl RFC][PATCH 1/5] media: Add media.h to headers_install
This makes the header available to the user-space apps when doing headers_install. Signed-off-by: Sergio Aguirre --- include/linux/Kbuild |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2fc8e14..efc9718 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -112,6 +112,7 @@ header-y += magic.h header-y += major.h header-y += map_to_7segment.h header-y += matroxfb.h +header-y += media.h header-y += meye.h header-y += minix_fs.h header-y += mmtimer.h -- 1.6.3.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
[media-ctl RFC][PATCH 3/5] v4l: Add v4l2-mediabus.h to headers_install
This complements commit ID: commit f1ee99adf3c73c6a2423c11813e17ca0227d98b7 Author: Laurent Pinchart Date: Mon Mar 15 23:33:31 2010 +0100 v4l: Move the media/v4l2-mediabus.h header to include/linux Signed-off-by: Sergio Aguirre --- include/linux/Kbuild |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/Kbuild b/include/linux/Kbuild index c5e8c6a..257812e 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -167,6 +167,7 @@ header-y += udf_fs_i.h header-y += ultrasound.h header-y += un.h header-y += utime.h +header-y += v4l2-mediabus.h header-y += v4l2-subdev.h header-y += veth.h header-y += videotext.h -- 1.6.3.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
[media-ctl RFC][PATCH 4/5] media: Add missing linux/types.h include
This fixes headers_check warning: */usr/include/linux/media.h:25: found __[us]{8,16,32,64} type without #include Signed-off-by: Sergio Aguirre --- include/linux/media.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/media.h b/include/linux/media.h index a44875d..4f39639 100644 --- a/include/linux/media.h +++ b/include/linux/media.h @@ -1,6 +1,8 @@ #ifndef __LINUX_MEDIA_H #define __LINUX_MEDIA_H +#include + #define MEDIA_ENTITY_TYPE_NODE 1 #define MEDIA_ENTITY_TYPE_SUBDEV 2 -- 1.6.3.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
[media-ctl RFC][PATCH 5/5] v4l: Add missing linux/types.h include
This fixes following headers_check warnings: */usr/include/linux/v4l2-mediabus.h:63: found __[us]{8,16,32,64} type without #include */usr/include/linux/v4l2-subdev.h:33: found __[us]{8,16,32,64} type without #include Signed-off-by: Sergio Aguirre --- include/linux/v4l2-mediabus.h |1 + include/linux/v4l2-subdev.h |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h index 6832919..2a8e490 100644 --- a/include/linux/v4l2-mediabus.h +++ b/include/linux/v4l2-mediabus.h @@ -11,6 +11,7 @@ #ifndef __LINUX_V4L2_MEDIABUS_H #define __LINUX_V4L2_MEDIABUS_H +#include #include /* diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h index 5df95d4..e2e2c8d 100644 --- a/include/linux/v4l2-subdev.h +++ b/include/linux/v4l2-subdev.h @@ -19,6 +19,7 @@ #define __LINUX_V4L2_SUBDEV_H #include +#include #include enum v4l2_subdev_format { -- 1.6.3.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
[media-ctl RFC][PATCH 2/5] v4l: Add v4l2-subdev.h to headers_install
This complements commit ID: commit cf16808f35cf59524fde0b15e5974cba165988b1 Author: Laurent Pinchart Date: Tue Mar 16 00:26:04 2010 +0100 v4l: v4l2_subdev userspace format API Signed-off-by: Sergio Aguirre --- include/linux/Kbuild |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/Kbuild b/include/linux/Kbuild index efc9718..c5e8c6a 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -167,6 +167,7 @@ header-y += udf_fs_i.h header-y += ultrasound.h header-y += un.h header-y += utime.h +header-y += v4l2-subdev.h header-y += veth.h header-y += videotext.h header-y += x25.h -- 1.6.3.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
[media-ctl RFC][PATCH 0/5] Exported headers to userspace fixes
Hi Laurent, While trying to generate kernel headers by doing 'make headers_install', I noticed that the headers weren't actually copied into the filesystem. So, here's some fixes I have come across. This is the baseline I use: http://gitorious.org/omap3camera/mainline/commits/devel Any feedback is greatly appreciated. Regards, Sergio Sergio Aguirre (5): media: Add media.h to headers_install v4l: Add v4l2-subdev.h to headers_install v4l: Add v4l2-mediabus.h to headers_install media: Add missing linux/types.h include v4l: Add missing linux/types.h include include/linux/Kbuild |3 +++ include/linux/media.h |2 ++ include/linux/v4l2-mediabus.h |1 + include/linux/v4l2-subdev.h |1 + 4 files changed, 7 insertions(+), 0 deletions(-) -- 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] V4L: Events: Include slab.h explicitly
After commit ID: commit de380b55f92986c1a84198149cb71b7228d15fbd Author: Tejun Heo Date: Wed Mar 24 17:06:43 2010 +0900 percpu: don't implicitly include slab.h from percpu.h slab.h include was not longer implicitly included with sched.h. So, now we have to include slab.h explicitly. Signed-off-by: Sergio Aguirre --- drivers/media/video/v4l2-event.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c index aea4332..7f31cd2 100644 --- a/drivers/media/video/v4l2-event.c +++ b/drivers/media/video/v4l2-event.c @@ -26,6 +26,7 @@ #include #include +#include #include int v4l2_event_init(struct v4l2_fh *fh) -- 1.6.3.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