Re: ACPI ambient light sensor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Martin Liška,

> Hello,
>    my kernel driver is still unable to start capturing in a proper way.
> First step for listening is
> 
> * echo 1 >
> /sys/bus/iio/devices/iio\:device0/scan_elements/in_illuminance1_en*
> *
> *
> but
> 
> *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*
> 
> Do you have any advices how to figure out where is problem?
> 
> Thank you,
> Martin
> 
> 
> /*
>  * 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/>.
>  */
> 
> #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>
> 
> #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>
> 
> #define PREFIX "ACPI: "
> 
> #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
> 
> #define ACPI_ALS_OUTPUTS 3
> 
> #define _COMPONENT ACPI_ALS_COMPONENT
> ACPI_MODULE_NAME("acpi-als");
> 
> MODULE_AUTHOR("Martin Liska");
> MODULE_DESCRIPTION("ACPI Ambient Light Sensor Driver");
> MODULE_LICENSE("GPL");
> 
> struct acpi_als_chip {
> struct acpi_device *device;
> struct acpi_als_device *acpi_als_sys;
> struct mutex lock;
> struct iio_trigger *trig;
> 
> int illuminance;
> int temperature;
> int chromaticity;
> int polling;
> 
> int count;
> struct acpi_als_mapping *mappings;
> };
> 
> 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);
> 
> static const struct acpi_device_id acpi_als_device_ids[] = {
> {"ACPI0008", 0},
> {"", 0},
> };
> 
> MODULE_DEVICE_TABLE(acpi, acpi_als_device_ids);
> 
> static struct acpi_driver acpi_als_driver = {
> .name = "acpi_als",
> .class = ACPI_ALS_CLASS,
> .ids = acpi_als_device_ids,
> .ops = {
> .add = acpi_als_add,
> .remove = acpi_als_remove,
> .notify = acpi_als_notify,
> },
> };
[...]

... again ...

_Please_ fix your mailer if you want to submit files inline, the indent is 
completely fucked. This behavior of yours definitelly does _NOT_ help anyone, it 
only puts unnecessary burden on the reader!
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux