Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2821395pxb; Sat, 6 Feb 2021 08:49:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw16merNPixpCoqri99abM1gsrsEViME41nkLqVl4bsNw97SBLQ0UUQo0fdIQBQUjgbG9nc X-Received: by 2002:a17:907:c27:: with SMTP id ga39mr9846446ejc.68.1612630148317; Sat, 06 Feb 2021 08:49:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612630148; cv=none; d=google.com; s=arc-20160816; b=Dhfx9Ai9vP7lbAtrDWasNoFncv5ywNmeGqy1+osXKu4acKMAQOmfIquWB6/bN7AOB+ iXil4ppJ/lgAd4irpvsfupA/McphJqmVtYMcM6UwYIQ9z6b9K4HbqN1mBYpUJJIQNGl2 XFiwmoV9QTMHq0r4AZ77wLYxqiSTt2uCBMa6x23dIgdjwMHxVCrOnO+t9ybBpR7sUmsL ipdTeheoWALT1AbUuPVU3UdoUn+yr7LsoHAGT4hhWLpb1FaSJ/jXPquBNYnm9wDxjU/r NjQ+wlubl3i6/LPQal/KUN9K8/NuiGqFZ69pNAEAifyadQ3Kydt3TCTupiVEdHonkONM Hg7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=WAzpIbDeMsFL5vwZ/Dnksr+hyoz1in3YUQekhz1jPUo=; b=uFdIog/T611ajlz4/zM7oTuzmrsK4qeSJSke9Q5hOrrPT6uMdG4ndVMLHDQ1EYATWF BKmlyi72Keyr+BI06lLK7RTSUel/x/c3RjuQGJHD8DB/NQ72TFIlyTvbRnY04IPMFZnb OCegkASd5Ez6KrK7F50jVCJ++klhW5tQ7udELXtfvk0GnXG2ftPcOowAsJDwOuSZmdUN cHLh/+gFrQFqi1/cfCdzYf0gxkQqng+2B0X3gpyq30ohQmbZWHsEGwaxj57+VOFQPQPq Ka3t+4qnOk+btHWGj0Svhu1NyZF43b/rjExoDFW8R8thaKAsc7jBD1ZiCHQnRuOL7owL 9lVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si7982248ejc.682.2021.02.06.08.48.44; Sat, 06 Feb 2021 08:49:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbhBFQR6 (ORCPT + 99 others); Sat, 6 Feb 2021 11:17:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:52878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhBFQR5 (ORCPT ); Sat, 6 Feb 2021 11:17:57 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B7C564EAC; Sat, 6 Feb 2021 16:17:15 +0000 (UTC) Date: Sat, 6 Feb 2021 16:17:11 +0000 From: Jonathan Cameron To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Dmitry Torokhov , Benson Leung , Guenter Roeck , Douglas Anderson , Gwendal Grignou , Enric Balletbo i Serra Subject: Re: [PATCH v4 3/3] iio: proximity: Add a ChromeOS EC MKBP proximity driver Message-ID: <20210206161711.6f555434@archlinux> In-Reply-To: <20210202184434.42644-4-swboyd@chromium.org> References: <20210202184434.42644-1-swboyd@chromium.org> <20210202184434.42644-4-swboyd@chromium.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Feb 2021 10:44:34 -0800 Stephen Boyd wrote: > Add support for a ChromeOS EC proximity driver that exposes a "front" > proximity sensor via the IIO subsystem. The EC decides when front > proximity is near and sets an MKBP switch 'EC_MKBP_FRONT_PROXIMITY' to > notify the kernel of proximity. Similarly, when proximity detects > something far away it sets the switch bit to 0. For now this driver > exposes a single sensor, but it could be expanded in the future via more > MKBP bits if desired. > > Cc: Dmitry Torokhov > Cc: Benson Leung > Cc: Guenter Roeck > Cc: Douglas Anderson > Cc: Gwendal Grignou > Reviewed-by: Enric Balletbo i Serra > Signed-off-by: Stephen Boyd Just one thing noticed on a final read through. I'm happy to fix up whilst applying. Otherwise all I'm waiting for now is to give Rob time to look at the device tree binding if he wants to do so. Jonathan > diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c > new file mode 100644 > index 000000000000..23bed4562b34 > --- /dev/null > +++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c > @@ -0,0 +1,242 @@ ... > +static struct platform_driver cros_ec_mkbp_proximity_driver = { > + .driver = { > + .name = "cros-ec-mkbp-proximity", > + .of_match_table = of_match_ptr(cros_ec_mkbp_proximity_of_match), I'm going to assume we know no one is going to use this with ACPI via PRP0001 given presumably the firmware on these devices is tightly controlled. However, we should should still drop the of_match_ptr as it will lead to an unused warning for cros_ec_mkbp_proximity_of_match if anyone builds this without CONFIG_OF + it sets a general bad precedence that I'd rather wasn't around for people to copy. Note that in general we are slowly ripping these out of IIO but probably lots still there. If this is all that is needed in this version I'll just do it whilst applying unless anyone shouts. Jonathan > + }, > + .probe = cros_ec_mkbp_proximity_probe, > + .remove = cros_ec_mkbp_proximity_remove, > +}; > +module_platform_driver(cros_ec_mkbp_proximity_driver); > + > +MODULE_LICENSE("GPL v2"); > +MODULE_DESCRIPTION("ChromeOS EC MKBP proximity sensor driver");