lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 19 Nov 2017 17:03:41 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Kiernan Hager <kah.listaddress@...il.com>
Cc:     Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Gabriele Mazzotta <gabriele.mzt@...il.com>,
        Marek Vasut <marex@...x.de>, linux-acpi@...r.kernel.org
Subject: Re: [RFC] iio: light: acpi-als: Enable the light sensor on the
 Zenbook UX430UQ

On Wed, 15 Nov 2017 20:27:54 -0700
Kiernan Hager <kah.listaddress@...il.com> wrote:

> This makes acpi-als properly enable the light sensor on the Zenbook UX430UQ. I don't know if the checking that I do to make sure that the ACPI method exists is sufficient or if it should disable the sensor when the module is unloaded, so input is appreciated on those matters.

Please wrap descriptions to around 72 characters (leaves room for indentation
in the email thread :)

This seems very much like a board specific hack.  I've cc'd people
who have worked on the driver recently and the acpi list.

> 
> Signed-off-by: Kiernan Hager <kah.listaddress@...il.com>
> ---
>  drivers/iio/light/acpi-als.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
> index c35e2f8df339..8fd66166f19f 100644
> --- a/drivers/iio/light/acpi-als.c
> +++ b/drivers/iio/light/acpi-als.c
> @@ -179,6 +179,10 @@ static int acpi_als_add(struct acpi_device *device)
>  	struct acpi_als *als;
>  	struct iio_dev *indio_dev;
>  	struct iio_buffer *buffer;
> +	unsigned long long temp_val;
> +	acpi_status status;
> +	struct acpi_object_list arg_list;
> +	union acpi_object arg;
>  
>  	indio_dev = devm_iio_device_alloc(&device->dev, sizeof(*als));
>  	if (!indio_dev)
> @@ -203,6 +207,18 @@ static int acpi_als_add(struct acpi_device *device)
>  
>  	iio_device_attach_buffer(indio_dev, buffer);
>  
> +	arg_list.count = 1;
> +	arg_list.pointer = &arg;
> +	arg.type = ACPI_TYPE_INTEGER;
> +	arg.integer.value = 1;
> +
> +	if (acpi_has_method(als->device->handle, "\\_SB.PCI0.LPCB.EC0.ALSC")) {
So this is poking something on
PCI bus 0
LPC bus B
Somethingbus 0
Ambient light controller.

I assume there is a better way of establishing this needs to be set?

> +		status = acpi_evaluate_integer(als->device->handle,
> +					       "\\_SB.PCI0.LPCB.EC0.ALSC",
> +					       &arg_list,
> +					       &temp_val);
> +	}
> +
>  	return devm_iio_device_register(&device->dev, indio_dev);
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ