All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@nokia.com>
To: ext Trilok Soni <soni.trilok@gmail.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] ARM: OMAP2: Camera: Add OMAP2 24xx camera driver.
Date: Fri, 02 Mar 2007 19:50:52 +0200	[thread overview]
Message-ID: <45E863FC.3060807@nokia.com> (raw)
In-Reply-To: <5d5443650702282326w79a4a4aexf0f33a804cd975c@mail.gmail.com>

Hi,

Thanks for your comments. They indeed were useful and I'm planning to do 
roughly everything I'm not commenting.

ext Trilok Soni wrote:
> On 2/28/07, Sakari Ailus <sakari.ailus@nokia.com> wrote:
>> +
>> +/* This should be called by the sensor code whenever it's ready */
>> +int omap24xxcam_sensor_register(struct omap_camera *oc,
>> +                               struct omap_camera_sensor *os)
>> +{
>> +       struct omap24xxcam_device *cam = oc->priv;
>> +       int rval;
>> +
>> +       /* the device has not been initialised yet */
>> +       if (cam == NULL)
>> +               return -ENODEV;
>> +       if (os == NULL)
>> +               return -EINVAL;
>> +       if (cam->sensor != NULL)
>> +               return -EBUSY;
>> +
>> +       cam->sensor = os;
>> +       rval = omap24xxcam_device_enable(cam);
>> +
>> +       if (rval)
>> +               cam->sensor = NULL;
>> +       return rval;
>> +}
>> +
>> +EXPORT_SYMBOL(omap24xxcam_sensor_register);
> 
> What registration functionality is done above? I can see only checking
> against the sensor initialization and enabling it if not. Please use
> proper name.

"cam->sensor = os;".

This gives the sensor to the camera. So I think the name is justified.

>> diff --git a/drivers/media/video/omap/omap24xxcam.c 
>> b/drivers/media/video/omap/omap24xxcam.c
>> new file mode 100644
>> index 0000000..4f954ed
>> --- /dev/null
>> +++ b/drivers/media/video/omap/omap24xxcam.c
...
>> +
>> +static void omap24xxcam_clock_put(struct omap24xxcam_device *cam)
>> +{
>> +       if (cam->img.ick == NULL)
>> +               return;
> 
> What about img.fck check ?

omap24xxcam_clock_get always get()s both or neither. Thus there's no 
need to check both.

>> +
>> +        */
>> +       /* choose an arbitrary xclk frequency */
>> +       omap24xxcam_core_xclk_set(&cam->core, 12000000);
>> +
>> +       omap24xxcam_camera.priv = cam;
>> +
>> +       if ((rval = omap24xxcam_sensor_init(cam))) {
>> +               goto err;
>> +       }
> 
> No need of { }. Also please use proper goto labels as suggested earlier.

There's only one label in that function. omap24xxcam_device_disable will 
do whatever was left behind by failed omap24xxcam_device_enable. (Or at 
least that's the idea.)

>> +
>> +       /* install the interrupt service routine */
>> +       if (request_irq(INT_24XX_CAM_IRQ, omap24xxcam_isr, IRQF_DISABLED,
>> +                       CAM_NAME, cam)) {
>> +               printk(KERN_ERR CAM_NAME
>> +                      ": could not install interrupt service 
>> routine\n");
>> +               goto err;
>> +       }
>> +       cam->irq = INT_24XX_CAM_IRQ;
> 
> Please make proper use of platform_data and resources. irq should have
> come from device.c registration of platform resource. Please check my
> patches.
> 
> http://linux.omap.com/pipermail/linux-omap-open-source/2007-February/009064.html 

I fully agree with that.

Regards,

-- 
Sakari Ailus
sakari.ailus@nokia.com

  reply	other threads:[~2007-03-02 17:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 15:49 [PATCH] OMAP2 camera and TCM825x sensor drivers Sakari Ailus
2007-02-28 15:59 ` [PATCH] ARM: OMAP2: Camera: Add OMAP2 24xx camera driver Sakari Ailus
2007-02-28 15:59   ` [PATCH] ARM: OMAP2: Camera: Add a driver for TCM825x sensor Sakari Ailus
2007-02-28 15:59     ` [PATCH] ARM: OMAP2: Camera: Modify sensor interface Sakari Ailus
2007-02-28 15:59       ` [PATCH] ARM: OMAP2: Camera: Adapt to 2.6.20 Sakari Ailus
2007-03-01  5:28         ` Trilok Soni
2007-03-02 11:49           ` Sakari Ailus
2007-03-01  7:26   ` [PATCH] ARM: OMAP2: Camera: Add OMAP2 24xx camera driver Trilok Soni
2007-03-02 17:50     ` Sakari Ailus [this message]
2007-03-02 15:18   ` Syed Mohammed, Khasim
2007-03-05  9:25     ` Sakari Ailus
2007-03-05 10:26       ` Trilok Soni
2007-03-02 19:12   ` Syed Mohammed, Khasim
     [not found]   ` <b8bf37780702280821wb17104chf75b973b420895ef@mail.gmail.com>
     [not found]     ` <200703010848.32757.andre.rosa@indt.org.br>
2007-03-14  9:29       ` Fwd: " Sakari Ailus
2007-02-28 16:39 ` [PATCH] OMAP2 camera and TCM825x sensor drivers Syed Mohammed, Khasim
2007-03-01  5:48   ` Trilok Soni
2007-03-01  8:06     ` tony
2007-03-01 23:03       ` Syed Mohammed, Khasim
2007-03-02  4:39         ` sahlot arvind
2007-03-02 11:15           ` André Goddard Rosa
2007-03-07 12:08         ` Sakari Ailus
2007-03-02  9:42   ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45E863FC.3060807@nokia.com \
    --to=sakari.ailus@nokia.com \
    --cc=linux-omap-open-source@linux.omap.com \
    --cc=soni.trilok@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.