Received: by 10.223.164.202 with SMTP id h10csp2934787wrb; Sun, 19 Nov 2017 09:39:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMYq0GkYsw1Rz3oL8WH0UrlH6glKjtQgKiOqlqDrbihGUGj2laW2mkz9GZHyyxiHB2a/NSwh X-Received: by 10.99.100.67 with SMTP id y64mr10997232pgb.19.1511113193609; Sun, 19 Nov 2017 09:39:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511113193; cv=none; d=google.com; s=arc-20160816; b=oDknDzTlinfbHaGe4lRS00AWMMC5eqhA0KPCL5sgC8djx0OLAmym90X+Dk8qs7esba sMBC5E+3yHapFFR+DLjPIBpMPquGt5QcJs/3jbAjoByRWlZBjqxvGydGyIHqiccGWoIX blYUvaaG9PRuPQQDyKLcUV7XuKtihp+rKM7nv531C/dDVFK6CILFBbZshBuzsM83EWlL rN+UjJ14vX+nDzLXDeoMJi1FV2WqutC1kYeL+2NxAADM0TqJeuZBczgXaHfbDdGQCRGt BBpW1F43No7M+GQCKWj8lP3MEwuLMGvyM9nOHFUHczA2Aag8jm4zPO+eI41+MmlGjcJZ Cl3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=77rajKHMu0+jOQmAmktA9lj4I8rJo2J3F4GKe7D7tqU=; b=iY4ocsAerbyac9nElL+HyHj7VXNb7CPIOjIqFOER1KgdFUJBKxNjEgA3udlxEiO6Cs NDnLnGemMOKawKFhttA46L4fSMFZDKqMMcpip4PyIAyC3yEAJV6AVgHY1zRmbrmbgcsc CPInjZIc+zx9GNNtxdb7/eBXQUY2UktbgfofitIY8D2aEtK0SkibEtKT6UghUXYyW/iO F3uvTTcffVw7wKr6ZrWJbhO2zssVSgPry4gRo/dLtmhHlk0zoxD11vnlGXJcgXpuHSFC xmXHIu3t6q2SVA6V6VRRlKVQ+ANhuGItuEy9UV/HVw48B4G8k5g6ZW8K5Pw1+PQMUzdK uDaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CsTHu9L+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si6464366plt.685.2017.11.19.09.39.34; Sun, 19 Nov 2017 09:39:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CsTHu9L+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751113AbdKSRil (ORCPT + 73 others); Sun, 19 Nov 2017 12:38:41 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38305 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdKSRii (ORCPT ); Sun, 19 Nov 2017 12:38:38 -0500 Received: by mail-lf0-f65.google.com with SMTP id c188so99809lfd.5; Sun, 19 Nov 2017 09:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=77rajKHMu0+jOQmAmktA9lj4I8rJo2J3F4GKe7D7tqU=; b=CsTHu9L+wRGEoqRC0wFEj7D+aqlf5TbAJhm2xQmWAWIyeRUo2Q8xNm7cosUf1rRk7L lM62iFbS77Ux093WQ388lkYDJCetk5/MFtk+ometJYqRzTzCih/4dM/Isi6ZMqqIYJKQ amHdkqPU/LpkMIoVwM7HbFL+pVicROA57F1jVirAJ9bzvia9mMubrOMJp3C61hV1elHB 9065J9gr6ZmCBueJtJlQcmTDuCqeJ0xdi6xDwBw3QeygtUPQO/dexs05UyF+e/rVQzKG XQvlJwxZizvyJJvVRuKGbx3nmpqUaRi2Z7SDoVjAY6hSQpea2brfwwD5jKRbYhtReJDl aqQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=77rajKHMu0+jOQmAmktA9lj4I8rJo2J3F4GKe7D7tqU=; b=XE1J4KMH54SqCXLek0/mRao6zVwF7FfIuKLsF180oK40fFNwYp9feh28++bnGsn1hr b5QPgagr3j++LbSuUENgCk1oMOLiGgUUNXg/k4cWUv5j1OQ9bo/Xwg6MmR6Cpbyf8JMz zSPMIE3gmnXAPdYwSXdVls0U/Khl/yOYbkf4ziVYE6DXS5mwxV+Cvo1fEX6//CkCrH8F 6Q5aY4uH8a3D8IqKuPWSeurXghdZDvKjuQmy/Cbh2pYgWmQ+dQiqEc4Wxhuwaks3Kmqg pDZSLPYZgxfV+rfdvwtqyLxwdASyEohxHGvG9q2dCPmT1Emh9npfKV88Xg915nfWfJvh y7UA== X-Gm-Message-State: AJaThX53W30ILKe2QSEcpETEAfLgfiD9tYWALRXaoHvbY2rYGqvXJKar cwXZTXXXVQ5exfL00J4w3TyP0I7WMdkYXTWhMkI= X-Received: by 10.25.28.149 with SMTP id c143mr2521517lfc.29.1511113116789; Sun, 19 Nov 2017 09:38:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.198.2 with HTTP; Sun, 19 Nov 2017 09:38:35 -0800 (PST) In-Reply-To: <20171119170341.62e5de3d@archlinux> References: <20171116032754.20719-1-kah.listaddress@gmail.com> <20171119170341.62e5de3d@archlinux> From: Gabriele Mazzotta Date: Sun, 19 Nov 2017 18:38:35 +0100 Message-ID: Subject: Re: [RFC] iio: light: acpi-als: Enable the light sensor on the Zenbook UX430UQ To: Jonathan Cameron Cc: Kiernan Hager , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, "linux-kernel@vger.kernel.org" , Marek Vasut , "linux-acpi@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-19 18:03 GMT+01:00 Jonathan Cameron : > On Wed, 15 Nov 2017 20:27:54 -0700 > Kiernan Hager wrote: > >> This makes acpi-als properly enable the light sensor on the Zenbook UX43= 0UQ. I don't know if the checking that I do to make sure that the ACPI meth= od 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 indenta= tion > 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. This is indeed board specific. I know many other laptops of the Zenbook line need something similar and if you look at drivers/platform/x86/asus-wmi.c or any other asus-* driver you'll find several quirks to enable various features. Kiernan, check commit aca234f6378864d85514be558746c0ea6eabfa8e ("asus-wmi: provide access to ALS control") in particular. >> >> Signed-off-by: Kiernan Hager >> --- >> 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 =3D 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 =3D 1; >> + arg_list.pointer =3D &arg; >> + arg.type =3D ACPI_TYPE_INTEGER; >> + arg.integer.value =3D 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 =3D acpi_evaluate_integer(als->device->handle, >> + "\\_SB.PCI0.LPCB.EC0.ALSC", >> + &arg_list, >> + &temp_val); >> + } >> + >> return devm_iio_device_register(&device->dev, indio_dev); >> } >> > From 1584514808684419187@xxx Sun Nov 19 17:04:37 +0000 2017 X-GM-THRID: 1584194897937602464 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread