From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ge Gao References: <1354670655-21946-1-git-send-email-ggao@invensense.com> <50BF407C.7020709@metafoo.de> <126d7591e6a837d8ff163685716e7f4b@mail.gmail.com> <50C0FCF3.3020207@metafoo.de> <50C10BC2.4000704@kernel.org> In-Reply-To: <50C10BC2.4000704@kernel.org> MIME-Version: 1.0 Date: Mon, 14 Jan 2013 10:40:52 -0800 Message-ID: Subject: RE: [PATCH] [PATCH V4] Invensense MPU6050 Device Driver. To: Jonathan Cameron , Lars-Peter Clausen Cc: linux-iio@vger.kernel.org Content-Type: multipart/alternative; boundary=047d7b6225e0360a4904d343fcb5 List-ID: --047d7b6225e0360a4904d343fcb5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable RE: [PATCH] [PATCH V4] Invensense MPU6050 Device Driver. Dear Jonanthan, I submitted another version of driver for Invensense MPU6050 last week. It basically fixed everything you said in the comments. It also removed the inv_mpu_misc file, which is not useful while taking too much spaces. However, only one thing I am not sure what to do with your comments= . In the trigger part, as the red part shown below, what that mean and what I am supposed to do to make a =93callback=94. Thanks. Best Regards, Ge GAO > +static int inv_mpu_data_rdy_trigger_set_state(struct iio_trigger *trig, > + bool state) > +{ > + struct iio_dev *indio_dev =3D trig->private_data; > + > + return set_inv_enable(indio_dev, state); Combine the above into one line. > +} > + > +static const struct iio_trigger_ops inv_mpu_trigger_ops =3D { > + .owner =3D THIS_MODULE, > + .set_trigger_state =3D &inv_mpu_data_rdy_trigger_set_state, You need some callbacks to prevent this being attached to another trigger... > +}; > + > +int inv_mpu_probe_trigger(struct iio_dev *indio_dev) > +{ > + int ret; > + struct inv_mpu_iio_s *st =3D iio_priv(indio_dev); > + > + st->trig =3D iio_trigger_alloc("%s-dev%d", --047d7b6225e0360a4904d343fcb5 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable RE: [PATCH] [PATCH V4] Invensense MPU6050 Device Driver.

Dear Jonanthan,<= /font>

=A0=A0=A0=A0=A0=A0=A0 I submitt= ed another version of driver for Invensense M= PU6050 last week.= It basically fixed everything you said in the comments. It also removed the inv_mpu_misc = file, which is not useful while taking too much spaces. However, only one thing I am not sure what to do with your comment= s. In the trigger= part, as the red= part shown below, what that mean and what I am supposed to do to make a =93callback=94. Thanks.

Best Regards,

Ge GAO

> +static int= inv_mpu_data_rdy_trigger_set_state(struct ii= o_trigger *trig,

> +=A0=A0=A0= =A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0= =A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 bool state)

> +{

> +=A0=A0=A0= =A0 struct iio_dev *indio_dev =3D trig->private_data;

> +

> +=A0=A0=A0= =A0 return set_inv_enable(indio_dev, state);

Combine the abov= e into one line.

> +}

> +

> +static con= st struct iio_trigger_ops inv_mpu_trigger_ops =3D {

> +=A0=A0=A0= =A0 .owner =3D THIS_MODULE,

> +=A0=A0=A0= =A0 .set_trigger_state =3D &inv_mpu_data_rdy_trigger_set_state,<= /span>

You need some callbacks to prevent this being attached to another<= /span>

trigger...

> +};<= /span>

> +

> +int inv_mp= u_probe_trigger(struct iio_dev *indio_dev)

> +{

> +=A0=A0=A0= =A0 int ret;

> +=A0=A0=A0= =A0 struct inv_mpu_iio_s *st =3D iio_priv(indio_dev);

> +

> +=A0=A0=A0= =A0 st->trig =3D iio_trigger_alloc("%s-dev%d",

--047d7b6225e0360a4904d343fcb5--