From: Rodolfo Giometti <giometti@enneenne.com>
To: "Richard Röjfors" <richard.rojfors@pelagicore.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@redhat.com>
Subject: Re: adv7180 as SoC camera device
Date: Tue, 30 Mar 2010 16:06:11 +0200 [thread overview]
Message-ID: <20100330140611.GR5937@enneenne.com> (raw)
In-Reply-To: <4B8310F1.8070005@pelagicore.com>
On Tue, Feb 23, 2010 at 12:19:13AM +0100, Richard Röjfors wrote:
>
> We use it as a subdev to a driver not yet committed from us. So I think
> you should extend it, not move it.
Finally I got something functional... but I'm puzzled to know how I
can add platform data configuration struct by using the I2C's
platform_data pointer if it is already used to hold struct
soc_camera_device... O_o
In fact my probe function looks like:
static __devinit int adv7180_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct adv7180_state *state;
struct soc_camera_device *icd = client->dev.platform_data;
struct soc_camera_link *icl;
struct v4l2_subdev *sd;
int ret;
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
v4l_info(client, "chip found @ 0x%02x (%s)\n",
client->addr << 1, client->adapter->name);
if (icd) {
icl = to_soc_camera_link(icd);
if (!icl)
return -EINVAL;
icd->ops = &adv7180_soc_ops;
v4l_info(client, "soc-camera support enabled\n");
} else
pdata = client->dev.platform_data;
state = kzalloc(sizeof(struct adv7180_state), GFP_KERNEL);
if (state == NULL) {
ret = -ENOMEM;
goto err;
}
state->irq = client->irq;
INIT_WORK(&state->work, adv7180_work);
mutex_init(&state->mutex);
state->autodetect = true;
sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &adv7180_ops);
...
Thanks in advance,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
next prev parent reply other threads:[~2010-03-30 14:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 17:44 adv7180 as SoC camera device Rodolfo Giometti
2010-02-19 19:36 ` Guennadi Liakhovetski
2010-02-22 16:01 ` Rodolfo Giometti
2010-02-22 16:11 ` Hans Verkuil
2010-02-22 16:15 ` Rodolfo Giometti
2010-02-22 16:46 ` Guennadi Liakhovetski
2010-02-22 16:16 ` Guennadi Liakhovetski
2010-02-22 16:53 ` Jonathan Cameron
2010-02-22 23:19 ` Richard Röjfors
2010-03-30 14:06 ` Rodolfo Giometti [this message]
2010-03-30 14:40 ` Guennadi Liakhovetski
2010-03-30 15:42 ` Rodolfo Giometti
2010-04-02 7:06 ` Guennadi Liakhovetski
2010-04-01 11:48 ` Rodolfo Giometti
2010-04-02 7:09 ` Guennadi Liakhovetski
2010-04-02 7:44 ` Rodolfo Giometti
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=20100330140611.GR5937@enneenne.com \
--to=giometti@enneenne.com \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=richard.rojfors@pelagicore.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.