Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2521413ybh; Mon, 16 Mar 2020 04:57:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvB14IM8Gx1oBa6YrdvtLD89jPlBhuHs9WS5DxacnGJ3B91xIR4UZozJ/LMMQUQ69OMxzoY X-Received: by 2002:aca:db41:: with SMTP id s62mr16359978oig.87.1584359871235; Mon, 16 Mar 2020 04:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584359871; cv=none; d=google.com; s=arc-20160816; b=i6JKlQ5BpuJzwDTljjyOukzF81dJzkWM0YuAKtp7mDQ4IreJd/lfJQWxwxMnK5tEMG yihvSDCr2PU5+hQN2dSy4IIsKZse9iI8diK0ubKngQ4MNEwLAJaQFJBXvCVwIHFRed17 JTakJLDsx41Ibla2wy1lk/qwDmng82mNYl0iN8S4Juhmcd6P9UBb6NEVDcMye+/UWOqn MIunrTc9jVLwHvLqrQ6nMxvEZS66ea3DcKdwEHUJ3aZLLNH59m6Lr9UQcmzbCqRGLKWQ LLv/4t+kS7OB9ywILVJn1Uuwrq0OhOiAENcM43oOOWmTwJwzvnw2SkBy+0o9i+Yr1FX5 TWYA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=OVGgIOe9sAUUZQKdkVD6kdzudv9frn17AQ2Jbhl+LWA=; b=sgg2TWtXVjntNKDntVVLE7yZe/r18NVTD0enlXwnqZq5GqsPYMZjYcOzEyxp8hngqR CilrBTnRliD8cAri7J1KeN6OG3kt/Bao3Lg64JHGEIHOfM8f/20TqeXdKzl2jSL/2fzO 762yXZjhkdtlKZCzXfyD32qlVoUHgI7lUASJMXEwBfpRaNqiwBN3MJnBMx7uSFPgLu/m 2hlkdjCxF4Ax8ST5sGBeTuWuMRzINfjyNJrqxGve8lnX4tDnQF07wyYVfUHjCPUnaN5Z 6nM7fe/h0ua29p7u0ue8Dl7HHP/awFxbFR1hX3Iz1BCCw2F0n4ryFXf171XCmFbSLiS0 TX+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21si6531694otk.100.2020.03.16.04.57.38; Mon, 16 Mar 2020 04:57:51 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730896AbgCPL4N (ORCPT + 99 others); Mon, 16 Mar 2020 07:56:13 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2564 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730882AbgCPL4M (ORCPT ); Mon, 16 Mar 2020 07:56:12 -0400 Received: from LHREML711-CAH.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 0AE0F9E51C01A518A474; Mon, 16 Mar 2020 11:56:11 +0000 (GMT) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by LHREML711-CAH.china.huawei.com (10.201.108.34) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 16 Mar 2020 11:56:10 +0000 Received: from localhost (10.47.94.88) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 16 Mar 2020 11:56:10 +0000 Date: Mon, 16 Mar 2020 11:56:08 +0000 From: Jonathan Cameron To: Matt Ranostay CC: Jonathan Cameron , Rohit Sarkar , "open list:IIO SUBSYSTEM AND DRIVERS" , open list , Alexandru Ardelean , Subject: Re: [PATCH] iio: health: max30100: use generic property handler Message-ID: <20200316115608.00003b34@Huawei.com> In-Reply-To: References: <5e6afe0d.1c69fb81.25912.f2eb@mx.google.com> <20200315124955.207d515c@archlinux> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.94.88] X-ClientProxiedBy: lhreml723-chm.china.huawei.com (10.201.108.74) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Mar 2020 01:08:20 -0700 Matt Ranostay wrote: > On Sun, Mar 15, 2020 at 5:50 AM Jonathan Cameron wrote: > > > > On Fri, 13 Mar 2020 08:59:13 +0530 > > Rohit Sarkar wrote: > > > > > Instead of of_property_read_xxx use device_property_read_xxx as it is > > > compatible with ACPI too as opposed to only device tree. > > > > > > Signed-off-by: Rohit Sarkar > > > > Look at how this driver is probing from DT. There is another thing you need > > to do to make it possible to use PRP001 ACPI based bindings. > > > > (check what Andy Shevchenko did in a similar patch) > > > > I'm being deliberately vague as useful for you to understand what is going > > on here for yourself :) > > > > Also, make sure to check you have cc'd everyone relevant. Here you are missing > > the driver author. +cc Matt > > Jonathan > > > > Highly doubt anyone is using this in an ACPI setting. Am I missing > something though? The 'new' wonder that is the ACPI ID PRP001. It lets you instantiate a device with a DT binding but using a chunk of DSDT. Where it comes in handy is if you happen to have an X86 machine that you are using to test and do it by overriding the DSDT (easy to do) to add whatever controller you are using and the device. Basically it is the ACPI equivalent of hacking the dt file for a board. Very convenient for testing device drivers. Jonathan > > - Matt > > > > --- > > > drivers/iio/health/max30100.c | 5 ++--- > > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c > > > index 84010501762d..8249c6b36818 100644 > > > --- a/drivers/iio/health/max30100.c > > > +++ b/drivers/iio/health/max30100.c > > > @@ -16,7 +16,7 @@ > > > #include > > > #include > > > #include > > > -#include > > > +#include > > > #include > > > #include > > > #include > > > @@ -267,11 +267,10 @@ static int max30100_get_current_idx(unsigned int val, int *reg) > > > static int max30100_led_init(struct max30100_data *data) > > > { > > > struct device *dev = &data->client->dev; > > > - struct device_node *np = dev->of_node; > > > unsigned int val[2]; > > > int reg, ret; > > > > > > - ret = of_property_read_u32_array(np, "maxim,led-current-microamp", > > > + ret = device_property_read_u32_array(dev, "maxim,led-current-microamp", > > > (unsigned int *) &val, 2); > > > if (ret) { > > > /* Default to 24 mA RED LED, 50 mA IR LED */ > >