Received: by 10.223.176.5 with SMTP id f5csp1702540wra; Sun, 28 Jan 2018 06:40:12 -0800 (PST) X-Google-Smtp-Source: AH8x2265HIBNrjBY7hCjxz2JtefswfaaHjeix3m8gIgbmeQAlT93OD6+QxWdQSg81C9y4XUYmZhQ X-Received: by 2002:a17:902:6881:: with SMTP id i1-v6mr19615849plk.323.1517150412715; Sun, 28 Jan 2018 06:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517150412; cv=none; d=google.com; s=arc-20160816; b=BXBD5m1syLlbiW9dx02v05QVWc4FZGCLTDYnlR7q/2z1iKsxHriEEeCrqNeFAAa1Pt qhsLyLmj4QIIbzX+RoSbA7VGTEO7ghBliGPVaiTGlGvOzdGFe641RzUWPUEYLh0jxk47 jCRZrp974Vf8EITkqgDWq64ojdZ/MhCx3s5ZJ4WwUH+m0JLtOQ3kMQDXI3g07XLMlFL5 OX4Q5arwju0HlkZN2OC/22JIs7uI1Ve4IjtyMBUPdtGGTF5n7KOeDcrQyYB0VOOZIFkS WSSmsDZucWxUodVTKOoK0K74TtczAWltMrAQKUt+RcvOj5B2oDHfAkOgLDYqc6em0WwQ lRiQ== 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=wadHR5wuJm3RTaoKQndDS+mtFQslIhP0rRvtDjEpmRw=; b=QgsJwdMhwWTUjyc2hnQjAdG+jHUKuq1QgAM3w0Smpgc0plqknhC+C9Gtu9zVlniALF 1AxlR4sgoDg8O5nkY18ZutqeUrEmHZJiouh0a63vLI6JDuhmDmhSJ+bQMpYK6X2QA0X9 ADT3/RiYL3whEg75/D4/Vm+XtQr/mkutmWkvQoWyhu71xDfyThypwG6H+nf/OYC0MTDw FNqr+31Hn5CT0xBbA2E5pe6hayLfkLoAtzL/WcVpAm3dOlVgbTiTpgXR9/tk5nVh+uCP BHkoy0ZN4YT8EBrYn0OSiuemUtfy4Pi/T0SqiQOMCSpXMcfTrhoREkiTqHrvJEZxeqam Qg3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DftjiiIw; 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 w81si7685602pfj.67.2018.01.28.06.39.58; Sun, 28 Jan 2018 06:40:12 -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=DftjiiIw; 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 S1751912AbeA1Ojc (ORCPT + 99 others); Sun, 28 Jan 2018 09:39:32 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:40423 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbeA1Oj1 (ORCPT ); Sun, 28 Jan 2018 09:39:27 -0500 Received: by mail-qt0-f181.google.com with SMTP id s39so9715103qth.7; Sun, 28 Jan 2018 06:39:27 -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=wadHR5wuJm3RTaoKQndDS+mtFQslIhP0rRvtDjEpmRw=; b=DftjiiIwaHDMkNEqZaktiLJTP4Ha7ur0IxEAyNu7oWjoXUmQPml/WHh/PGWbFHwMhS YihhyQKxFvPONk6Ap/VtoaRy+EFgP2P14bdn8zIHIW0HGF9wlkZvQ+Pu1+r8ns5vu8Aj lxuGELdSNLTk5iOiD4U2Qhky0PuvRedbFRcGD8+CfU1/BHItv241VfWec+L1kigER69W mV/t6lfTFJV7hcnykWL8MMce16VHIuyX25SN9tXKLNy0GEOuwOS0uDNqhTGpXU0j1jtP x4ukX6K/ndJ2QbQShsZEJxdrOK3PWyVWypQkc5Vsh87auPHLbdlA/e7itVncrq2yQkRy r1BA== 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=wadHR5wuJm3RTaoKQndDS+mtFQslIhP0rRvtDjEpmRw=; b=kWTxxaG1H845y/fqcRDLI34Eep3fcuXY1/PmJ4gEKxf5lcA7Q3miWw+hBUMT4cPWu1 3EM2WtrtRAvG10dn2pNMMXgcxZXI1nk/2XXHx/4w+IbLejEcRJ8+WzHGbMd1VRy5Nb0f qnPEmiZFOa5xLpJTk3UOPpzRs8q66X7qzQ5aGPmsXSsvNcAvN/C7SVvd+imb/+WrCw2j fTYsDj0cqmVw6+GJGlH3nOerUDsNeM1F7Jj5zezOc4OOjCiyoE++NEQu+WUhda6ufLfU WJXUw64lLwq9g+7d/cg/bH5MWrMKxIzGD04hchpH94+LEKPyV3ThYE0pfAGgQM7eKA6Y +6nA== X-Gm-Message-State: AKwxytclql1pa6rvFYaztqU6KKfWe2z10rWV3zRN3Z1AOx01ckv4v+uN EbOAdZTizeD0tPb5IZukbyKYO8sGhpEVqlub3SM= X-Received: by 10.200.22.187 with SMTP id r56mr32047107qtj.190.1517150366473; Sun, 28 Jan 2018 06:39:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.175.35 with HTTP; Sun, 28 Jan 2018 06:39:25 -0800 (PST) In-Reply-To: <20180127133209.28995-1-pali.rohar@gmail.com> References: <20180127133209.28995-1-pali.rohar@gmail.com> From: Andy Shevchenko Date: Sun, 28 Jan 2018 16:39:25 +0200 Message-ID: Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Jean Delvare , Wolfram Sang , =?UTF-8?B?TWljaGHFgiBLxJlwaWXFhA==?= , Steven Honeyman , Valdis Kletnieks , Jochen Eisinger , Gabriele Mazzotta , Andy Lutomirski , Mario Limonciello , Alex Hung , Takashi Iwai , linux-i2c , Linux Kernel Mailing List , Platform Driver 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 On Sat, Jan 27, 2018 at 3:32 PM, Pali Roh=C3=A1r wro= te: > Dell platform team told us that some (DMI whitelisted) Dell Latitude > machines have ST microelectronics accelerometer at i2c address 0x29. > > Presence of that ST microelectronics accelerometer is verified by existen= ce > of SMO88xx ACPI device which represent that accelerometer. Unfortunately > ACPI device does not specify i2c address. > > This patch registers lis3lv02d device for selected Dell Latitude machines > at i2c address 0x29 after detection. And for Dell Vostro V131 machine at > i2c address 0x1d which was manually detected. > > Finally commit a7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to > conflict with PCI BAR") allowed to use i2c-i801 driver on Dell machines s= o > lis3lv02d correctly initialize accelerometer. > > Tested on Dell Latitude E6440. > +static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle, > + u32 nesting_level, > + void *context, > + void **return_value) > +{ > + struct acpi_device_info *info; > + acpi_status status; > + char *hid; > + > + status =3D acpi_get_object_info(obj_handle, &info); > + if (!ACPI_SUCCESS(status) || !(info->valid & ACPI_VALID_HID)) > + return AE_OK; > + > + hid =3D info->hardware_id.string; > + if (!hid) > + return AE_OK; > + > + if (strlen(hid) < 7) > + return AE_OK; > + > + if (memcmp(hid, "SMO88", 5) !=3D 0) > + return AE_OK; > + > + *((bool *)return_value) =3D true; > + return AE_CTRL_TERMINATE; > +} > + > +static bool is_dell_system_with_lis3lv02d(void) > +{ > + /* > + * Check that ACPI device SMO88xx exists and is enabled. That ACP= I > + * device represent our ST microelectronics lis3lv02d acceleromet= er but > + * unfortunately without any other information (like i2c address)= . > + */ Isn't it simple return acpi_dev_present("SMO88", NULL, -1); call? > + found =3D false; > + status =3D acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL= , > + (void **)&found); > + if (!ACPI_SUCCESS(status) || !found) > + return false; > + > + return true; > +} --=20 With Best Regards, Andy Shevchenko