From: Marek Vasut <marex@denx.de>
To: "Martin Liška" <marxin.liska@gmail.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
platform-driver-x86@vger.kernel.org, linux-iio@vger.kernel.org,
Zhang Rui <rui.zhang@intel.com>,
Corentin Chary <corentin.chary@gmail.com>, joeyli <jlee@suse.com>,
Len Brown <len.brown@intel.com>,
pavel@denx.de, Jonathan Cameron <jic23@kernel.org>,
Jon Brenner <jbrenner@taosinc.com>,
Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: ACPI ambient light sensor
Date: Sun, 21 Oct 2012 19:32:25 +0200 [thread overview]
Message-ID: <201210211932.26094.marex@denx.de> (raw)
In-Reply-To: <CAObPJ3PB0VYNE9vhrwJRA9jpWX6p7_Kw8T2eCMgj0M0zJ9feUA@mail.gmail.com>
Dear Martin Li=C5=A1ka,
> Hello,
> my kernel driver is still unable to start capturing in a proper way.
> First step for listening is
>=20
> * echo 1 >
> /sys/bus/iio/devices/iio\:device0/scan_elements/in_illuminance1_en*
> *
> *
> but
>=20
> *cat /sys/bus/iio/devices/iio\:device0/scan_elements/in_illuminance1_en*
> *-1*
> *
> *
> I tried to decorate all result codes with printf.
> Dmesg dump:
> *[ 0.927335] XXX: trigger init called*
> *[ 0.928148] XXX: acpi_als_allocate_trigger: 0*
> *[ 0.928275] XXX: acpi_als_trigger_init: 0*
> *[ 3.255305] XXX: getting data for filling buffer*
> *[ 3.255352] XXX: buffer is ready*
> *[ 27.423650] XXX: getting data for filling buffer*
> *[ 27.423698] XXX: buffer is ready*
> *[ 30.444120] XXX: getting data for filling buffer*
>=20
> Do you have any advices how to figure out where is problem?
>=20
> Thank you,
> Martin
>=20
>=20
> /*
> * ACPI Ambient Light Sensor Driver
> *
> * This program is free software; you can redistribute it and/or modify it
> * under the terms and conditions of the GNU General Public License,
> * version 2, as published by the Free Software Foundation.
> *
> * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
> */
>=20
> #include <linux/module.h>
> #include <linux/interrupt.h>
> #include <trace/events/printk.h>
> #include <acpi/acpi_bus.h>
> #include <acpi/acpi_drivers.h>
> #include <linux/err.h>
> #include <linux/mutex.h>
>=20
> #include <linux/iio/iio.h>
> #include <linux/iio/buffer.h>
> #include <linux/iio/sysfs.h>
> #include <linux/iio/trigger.h>
> #include <linux/iio/trigger_consumer.h>
> #include <linux/iio/triggered_buffer.h>
>=20
> #define PREFIX "ACPI: "
>=20
> #define ACPI_ALS_CLASS "als"
> #define ACPI_ALS_DEVICE_NAME "acpi-als"
> #define ACPI_ALS_NOTIFY_ILLUMINANCE 0x80
> #define ACPI_ALS_NOTIFY_COLOR_TEMP 0x81
> #define ACPI_ALS_NOTIFY_RESPONSE 0x82
>=20
> #define ACPI_ALS_OUTPUTS 3
>=20
> #define _COMPONENT ACPI_ALS_COMPONENT
> ACPI_MODULE_NAME("acpi-als");
>=20
> MODULE_AUTHOR("Martin Liska");
> MODULE_DESCRIPTION("ACPI Ambient Light Sensor Driver");
> MODULE_LICENSE("GPL");
>=20
> struct acpi_als_chip {
> struct acpi_device *device;
> struct acpi_als_device *acpi_als_sys;
> struct mutex lock;
> struct iio_trigger *trig;
>=20
> int illuminance;
> int temperature;
> int chromaticity;
> int polling;
>=20
> int count;
> struct acpi_als_mapping *mappings;
> };
>=20
> static int acpi_als_add(struct acpi_device *device);
> static int acpi_als_remove(struct acpi_device *device, int type);
> static void acpi_als_notify(struct acpi_device *device, u32 event);
>=20
> static const struct acpi_device_id acpi_als_device_ids[] =3D {
> {"ACPI0008", 0},
> {"", 0},
> };
>=20
> MODULE_DEVICE_TABLE(acpi, acpi_als_device_ids);
>=20
> static struct acpi_driver acpi_als_driver =3D {
> .name =3D "acpi_als",
> .class =3D ACPI_ALS_CLASS,
> .ids =3D acpi_als_device_ids,
> .ops =3D {
> .add =3D acpi_als_add,
> .remove =3D acpi_als_remove,
> .notify =3D acpi_als_notify,
> },
> };
[...]
=2E.. again ...
_Please_ fix your mailer if you want to submit files inline, the indent is=
=20
completely fucked. This behavior of yours definitelly does _NOT_ help anyon=
e, it=20
only puts unnecessary burden on the reader!
next prev parent reply other threads:[~2012-10-21 17:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 20:03 ACPI ambient light sensor Martin Liška
2012-07-08 20:28 ` Marek Vasut
2012-07-09 13:29 ` Jonathan Cameron
2012-09-11 7:48 ` Martin Liška
2012-09-11 8:27 ` Marek Vasut
2012-09-11 8:35 ` Peter Meerwald
2012-09-11 9:21 ` Marek Vasut
2012-10-21 17:02 ` Martin Liška
2012-10-21 17:32 ` Marek Vasut [this message]
2012-10-21 18:05 ` Jonathan Cameron
2012-10-27 16:39 ` Martin Liška
2012-10-27 17:08 ` Jonathan Cameron
2012-10-27 18:00 ` Corentin Chary
2012-11-29 2:46 ` ACPI ALS patch marxin.liska
2012-11-29 2:46 ` [PATCH] ACPI ALS driver for iio introduced marxin.liska
2012-11-29 8:02 ` Corentin Chary
2012-11-29 10:18 ` Lars-Peter Clausen
[not found] ` <CAObPJ3NM7mn+pXJ801hC2Dn7t9kqp4X_FuD8TSmJ6-eH7UP8pA@mail.gmail.com>
2012-12-02 11:20 ` Corentin Chary
2012-11-29 10:15 ` Lars-Peter Clausen
2012-12-01 16:46 ` Martin Liška
2012-12-02 13:24 ` Jonathan Cameron
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=201210211932.26094.marex@denx.de \
--to=marex@denx.de \
--cc=corentin.chary@gmail.com \
--cc=jbrenner@taosinc.com \
--cc=jic23@cam.ac.uk \
--cc=jic23@kernel.org \
--cc=jlee@suse.com \
--cc=len.brown@intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=marxin.liska@gmail.com \
--cc=pavel@denx.de \
--cc=platform-driver-x86@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=rui.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).