All of lore.kernel.org
 help / color / mirror / Atom feed
* How to acces TVP5150 .command function from userspace
@ 2009-05-22  7:50 景文林
  2009-05-22  8:40 ` Dongsoo, Nathaniel Kim
  2009-05-22 13:40 ` Devin Heitmueller
  0 siblings, 2 replies; 6+ messages in thread
From: 景文林 @ 2009-05-22  7:50 UTC (permalink / raw)
  To: video4linux-list

Hi,

I am working with a video capture chip TVP5150. I want to adjust the
"Brightness" "Contrast" "Saturation" and "hue" in user space.
In TVP5150 drivers ,the V4l2 commands are in function tvp5150_command.And
this function is a member of struct i2c_device.

The linux is 2.6.19.2.
I write my code according kernel document  Documentation/i2c/dev-interface
But I can`t access tvp5150_command.
How can i acces i2c_device .command  function from user space?


william.jing
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to acces TVP5150 .command function from userspace
  2009-05-22  7:50 How to acces TVP5150 .command function from userspace 景文林
@ 2009-05-22  8:40 ` Dongsoo, Nathaniel Kim
  2009-05-22 13:40 ` Devin Heitmueller
  1 sibling, 0 replies; 6+ messages in thread
From: Dongsoo, Nathaniel Kim @ 2009-05-22  8:40 UTC (permalink / raw)
  To: 景文林; +Cc: linux-media

Hello William,

First of all, the video4linux-list has been moved to linux-media list
at vger.kernel.org. The exact list address is
linux-media@vger.kernel.org and you can find other lists on
http://vger.kernel.org. I removed the old list from CC and added the
new list instead. I hope you don't mind.

And about TVP5150 thing, I have been developing in similar way few
years ago but in my case, I had a controller device which was
video4linux device and took care of v4l2 ioctls in that controller and
send command to i2c client. But in case of TVP5150, I can't figure it
out which device could be that kind of controller device acting v4l2
device. I'm sorry about that and hope someone else (I think Mauro can)
can answer this.
Cheers,

Nate

On Fri, May 22, 2009 at 4:50 PM, 景文林 <wenlinjing@gmail.com> wrote:
> Hi,
>
> I am working with a video capture chip TVP5150. I want to adjust the
> "Brightness" "Contrast" "Saturation" and "hue" in user space.
> In TVP5150 drivers ,the V4l2 commands are in function tvp5150_command.And
> this function is a member of struct i2c_device.
>
> The linux is 2.6.19.2.
> I write my code according kernel document  Documentation/i2c/dev-interface
> But I can`t access tvp5150_command.
> How can i acces i2c_device .command  function from user space?
>
>
> william.jing
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list
>



-- 
=
DongSoo, Nathaniel Kim
Engineer
Mobile S/W Platform Lab.
Digital Media & Communications R&D Centre
Samsung Electronics CO., LTD.
e-mail : dongsoo.kim@gmail.com
          dongsoo45.kim@samsung.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to acces TVP5150 .command function from userspace
  2009-05-22  7:50 How to acces TVP5150 .command function from userspace 景文林
  2009-05-22  8:40 ` Dongsoo, Nathaniel Kim
@ 2009-05-22 13:40 ` Devin Heitmueller
  2009-05-23  6:30   ` Dongsoo, Nathaniel Kim
  2009-05-23 15:26   ` Markus Rechberger
  1 sibling, 2 replies; 6+ messages in thread
From: Devin Heitmueller @ 2009-05-22 13:40 UTC (permalink / raw)
  To: 景文林; +Cc: video4linux-list

On Fri, May 22, 2009 at 3:50 AM, 景文林 <wenlinjing@gmail.com> wrote:
> Hi,
>
> I am working with a video capture chip TVP5150. I want to adjust the
> "Brightness" "Contrast" "Saturation" and "hue" in user space.
> In TVP5150 drivers ,the V4l2 commands are in function tvp5150_command.And
> this function is a member of struct i2c_device.
>
> The linux is 2.6.19.2.
> I write my code according kernel document  Documentation/i2c/dev-interface
> But I can`t access tvp5150_command.
> How can i acces i2c_device .command  function from user space?

I thought those controls were already implemented in the tvp5150
driver, although I could be mistaken (I would have to look at the
code).  If not, it would probably be much easier to just add the
commands to the driver than to attempt to program the chip from
userland (the datasheet for the tvp5150 is freely available).

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to acces TVP5150 .command function from userspace
  2009-05-22 13:40 ` Devin Heitmueller
@ 2009-05-23  6:30   ` Dongsoo, Nathaniel Kim
  2009-05-23 15:26   ` Markus Rechberger
  1 sibling, 0 replies; 6+ messages in thread
From: Dongsoo, Nathaniel Kim @ 2009-05-23  6:30 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: video4linux-list

Actually those controls should be supported by VIDIOC_S_CTRL but not
sure on 2.6.19.
I took a snapshot of 2.6.19 kernel from git but couldn't find any of
v4l2_ioctl_ops in tvp5150. Possibly not have been using v4l2_ioctl_ops
in that time I guess (not sure)
Anyway, controls that william is trying to use should be controled via
VIDIOC_S_CTRL with CID and as far as I checked in 2.6.19, it already
had those CIDs. So, it could be worth to give a shot with
VIDIOC_S_CTRL.
Cheers,

Nate

2009/5/22 Devin Heitmueller <dheitmueller@kernellabs.com>:
> On Fri, May 22, 2009 at 3:50 AM, 景文林 <wenlinjing@gmail.com> wrote:
>> Hi,
>>
>> I am working with a video capture chip TVP5150. I want to adjust the
>> "Brightness" "Contrast" "Saturation" and "hue" in user space.
>> In TVP5150 drivers ,the V4l2 commands are in function tvp5150_command.And
>> this function is a member of struct i2c_device.
>>
>> The linux is 2.6.19.2.
>> I write my code according kernel document  Documentation/i2c/dev-interface
>> But I can`t access tvp5150_command.
>> How can i acces i2c_device .command  function from user space?
>
> I thought those controls were already implemented in the tvp5150
> driver, although I could be mistaken (I would have to look at the
> code).  If not, it would probably be much easier to just add the
> commands to the driver than to attempt to program the chip from
> userland (the datasheet for the tvp5150 is freely available).
>
> Devin
>
> --
> Devin J. Heitmueller - Kernel Labs
> http://www.kernellabs.com
>
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list
>



-- 
=
DongSoo, Nathaniel Kim
Engineer
Mobile S/W Platform Lab.
Digital Media & Communications R&D Centre
Samsung Electronics CO., LTD.
e-mail : dongsoo.kim@gmail.com
          dongsoo45.kim@samsung.com

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to acces TVP5150 .command function from userspace
  2009-05-22 13:40 ` Devin Heitmueller
  2009-05-23  6:30   ` Dongsoo, Nathaniel Kim
@ 2009-05-23 15:26   ` Markus Rechberger
  2009-05-25  2:01     ` 景文林
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Rechberger @ 2009-05-23 15:26 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: video4linux-list

2009/5/22 Devin Heitmueller <dheitmueller@kernellabs.com>:
> On Fri, May 22, 2009 at 3:50 AM, 景文林 <wenlinjing@gmail.com> wrote:
>> Hi,
>>
>> I am working with a video capture chip TVP5150. I want to adjust the
>> "Brightness" "Contrast" "Saturation" and "hue" in user space.
>> In TVP5150 drivers ,the V4l2 commands are in function tvp5150_command.And
>> this function is a member of struct i2c_device.
>>
>> The linux is 2.6.19.2.
>> I write my code according kernel document  Documentation/i2c/dev-interface
>> But I can`t access tvp5150_command.
>> How can i acces i2c_device .command  function from user space?
>
> I thought those controls were already implemented in the tvp5150
> driver, although I could be mistaken (I would have to look at the
> code).  If not, it would probably be much easier to just add the
> commands to the driver than to attempt to program the chip from
> userland (the datasheet for the tvp5150 is freely available).
>

those are definitely implemented, I remember there was a problem with
a too dark videopicture years ago and it was a bug in the tvp5150...

Also by looking at it:
V4L2_CID_BRIGHTNESS
V4L2_CID_CONTRAST
V4L2_CID_SATURATION
V4L2_CID_HUE

are supported.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to acces TVP5150 .command function from userspace
  2009-05-23 15:26   ` Markus Rechberger
@ 2009-05-25  2:01     ` 景文林
  0 siblings, 0 replies; 6+ messages in thread
From: 景文林 @ 2009-05-25  2:01 UTC (permalink / raw)
  To: Markus Rechberger; +Cc: video4linux-list

Thank you for reply!
I`m sorry that I did not describe my problem clearly.

In tvp5150 driver,the v4l2 controls(VIDIOC_G_CTRL like)that i need are
already implemented. part of the driver as follow:
static int tvp5150_command(struct i2c_client *c,unsigned int cmd, void *arg)
{
    struct tvp5150 *decoder = i2c_get_clientdata(c);

    switch (cmd) {

    case 0:
    case VIDIOC_INT_RESET:
    ...
    case VIDIOC_G_CTRL:
    ...
}
static struct i2c_driver driver = {
    .driver = {
        .name = "tvp5150",
    },
    .id = I2C_DRIVERID_TVP5150,

    .attach_adapter = tvp5150_attach_adapter,
    .detach_client = tvp5150_detach_client,

    .command = tvp5150_command,
};

I want to access the tvp5150_command function in userland . I opened
/dev/i2c-0 and called ioctl like that:
if (ioctl(file,I2C_SLAVE_FORCE,addr) < 0) {    /*addr is tvp5150 address*/
    exit(1);
 }

 if (ioctl(file,VIDIOC_G_CTRL,addr) < 0)
...
It`s absolute wrong but I don`t know how to call VIDIOC_G_CTRL control.

Regards,
william











2009/5/23 Markus Rechberger <mrechberger@gmail.com>

> 2009/5/22 Devin Heitmueller <dheitmueller@kernellabs.com>:
> > On Fri, May 22, 2009 at 3:50 AM, 景文林 <wenlinjing@gmail.com> wrote:
> >> Hi,
> >>
> >> I am working with a video capture chip TVP5150. I want to adjust the
> >> "Brightness" "Contrast" "Saturation" and "hue" in user space.
> >> In TVP5150 drivers ,the V4l2 commands are in function
> tvp5150_command.And
> >> this function is a member of struct i2c_device.
> >>
> >> The linux is 2.6.19.2.
> >> I write my code according kernel document
>  Documentation/i2c/dev-interface
> >> But I can`t access tvp5150_command.
> >> How can i acces i2c_device .command  function from user space?
> >
> > I thought those controls were already implemented in the tvp5150
> > driver, although I could be mistaken (I would have to look at the
> > code).  If not, it would probably be much easier to just add the
> > commands to the driver than to attempt to program the chip from
> > userland (the datasheet for the tvp5150 is freely available).
> >
>
> those are definitely implemented, I remember there was a problem with
> a too dark videopicture years ago and it was a bug in the tvp5150...
>
> Also by looking at it:
> V4L2_CID_BRIGHTNESS
> V4L2_CID_CONTRAST
> V4L2_CID_SATURATION
> V4L2_CID_HUE
>
> are supported.
>
> Markus
>
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-25  2:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-22  7:50 How to acces TVP5150 .command function from userspace 景文林
2009-05-22  8:40 ` Dongsoo, Nathaniel Kim
2009-05-22 13:40 ` Devin Heitmueller
2009-05-23  6:30   ` Dongsoo, Nathaniel Kim
2009-05-23 15:26   ` Markus Rechberger
2009-05-25  2:01     ` 景文林

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.