Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp639514ybl; Thu, 12 Dec 2019 02:28:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzsomhafSn4dK0DzzatKVLNdjxR72r4P61jJYMelqvhz4zsxhBSK0ySqjeeU7jj2WnIrvqn X-Received: by 2002:a05:6830:1e5a:: with SMTP id e26mr6946225otj.351.1576146502558; Thu, 12 Dec 2019 02:28:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576146502; cv=none; d=google.com; s=arc-20160816; b=X2A6H0eJ4WE/TbDbKxZ6Hk2yhdze1nMTy+9omllWANtmA3rGYI6bO3Mxu+xHuQa/sK OJQf9/UX0/px8ymw8rxuGWFCUCEuFWMO9Pc0i9+6qf/SfzyGbC4oml12WpxFPzcMzOa9 L0BP4BsJ6BWryVH+wVK9pzZQ12NRnHYhfKT3qXBVhfAo6D+wlrQCZEecOGX22qh5b3le hmOCuAvTKi1CJlaUyAZN+00IMHaoVt+mo7ZjrGV4et4BkQG/yvanl9CdjQpyCZtURgf5 djAD4KuwGE0sIu02zFUzXtHb7MELmzcKF5edFOkNfuY6BMwFO8ok188dkgOxG1tMSWBG 6SWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=X1IjxJJxDMWAlUZ4WjR8vfjxD9i7QeZnQLbWau+hr2w=; b=WQATqteERn2rGHP0jG5LCusu5Cifl/rPKSuEqaxc+BdKyozhorVX3P6bTrAKuewkGW a5pCcCwmM90i57bWai5NMAgAhXoHBY/o6YYZtK9ybCvykPH8CgwqdKBy/X41APBRW2P5 gWcO19qUl13K6JpbMgx3GImY+BA+k2DFJ6cpuuaINCFkyaV94CObHPW+z3eIrmzno235 loqLMdZXw1e4egIxgZZXfX7jb6MmbQO/VNiBoI9maF8pBPnEk/6BfcY1hR3Ur2OXCfhU 7upKlrP0s1AVVSoze/aD/JMsSGxc8P8mPMAEKRQzshSHHANmdgixB5yX50kfiUDlcjy7 CKCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zKrVndDf; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si2690622oip.248.2019.12.12.02.28.09; Thu, 12 Dec 2019 02:28:22 -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=@linaro.org header.s=google header.b=zKrVndDf; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728627AbfLLK12 (ORCPT + 99 others); Thu, 12 Dec 2019 05:27:28 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45235 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728555AbfLLK11 (ORCPT ); Thu, 12 Dec 2019 05:27:27 -0500 Received: by mail-lj1-f196.google.com with SMTP id d20so1638085ljc.12 for ; Thu, 12 Dec 2019 02:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1IjxJJxDMWAlUZ4WjR8vfjxD9i7QeZnQLbWau+hr2w=; b=zKrVndDfMw5glaHDvVVAERCr6kNERWEAEMaXnAn6XjQp1Dz/ANs2Bs7QXF0mQR/Cz2 nJq0uiTRUI3KdAfk94Snpeb5sFuFc/+MjT+xGMz7lVSrbWVIMg1wk0Bo7Vdx6zRT0Nwp jLhzeS9MJVDq/XIfd9aBvnCKoN9Py6x7OHzWKLGzROylVGLJIa1F9LbGhaOyzkSWLlNg PMmv5RSR22LOqjofX27f+enAaGR/ruNw47HlU9/dwmk4sPOTsPo1DNXe0IZH3BS1hDMp v5HpUjV3QdTya4PFNm84l69+yY6Rl07fkHSbD4ILn9bLvr3w5FD75QFUCNLLK0adbwu1 bUzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1IjxJJxDMWAlUZ4WjR8vfjxD9i7QeZnQLbWau+hr2w=; b=LVOIb8kGmF/reoho95gT9ThXpF/OIGgWDVPsuGM3A6TUkWOZcXXhT/RRFjckNTmfub MMUpCj6M/bheVsvOIOVdwoDAPxMAJhVDNgC4OXMKe/+0qHqtLJVtTSweKtt2MfRO5H/f UJlAApBLvEBP6QR18ipwxchbdcpn59OGnJJsc+F0PNm2aDKlC/hbCd0t1o7O3eSgR2SL 1IePj70CjR1vW13MPgyd/UXwjrdWF/GdNJmf0uCG1cRGrpwTu6vTGGpMxT39rip9f4gG 2yqzN0NyHvVGPELLLrupcuJaRo9DpMohwypzTGwWWVaukawYPU7/KPw4TDbmsgZZB4i4 Butg== X-Gm-Message-State: APjAAAX1rc1eaKCDSka0hGMUJCXpzO+EuG3DRhjmnIJmmWv9MgOwQcnU S1j0kx+4whR7on0zI39Pqq/ryOtu66ouCKrQ+fzdRw== X-Received: by 2002:a2e:844e:: with SMTP id u14mr5340967ljh.183.1576146445650; Thu, 12 Dec 2019 02:27:25 -0800 (PST) MIME-Version: 1.0 References: <20191211010308.1525-1-dan@dlrobertson.com> <20191211010308.1525-3-dan@dlrobertson.com> In-Reply-To: <20191211010308.1525-3-dan@dlrobertson.com> From: Linus Walleij Date: Thu, 12 Dec 2019 11:27:13 +0100 Message-ID: Subject: Re: [PATCH v6 2/2] iio: (bma400) add driver for the BMA400 To: Dan Robertson Cc: Jonathan Cameron , linux-iio@vger.kernel.org, Peter Meerwald-Stadler , Andy Shevchenko , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Hartmut Knaack , Rob Herring , Mark Rutland , "linux-kernel@vger.kernel.org" , Randy Dunlap , Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, thanks for your patch! Inspired by my recent work to revive the BMA180/BMA250 driver for BMA254 I have some comments: On Wed, Dec 11, 2019 at 2:20 AM Dan Robertson wrote: > Add a IIO driver for the Bosch BMA400 3-axes ultra-low power accelerometer. > The driver supports reading from the acceleration and temperature > registers. The driver also supports reading and configuring the output data > rate, oversampling ratio, and scale. > > Signed-off-by: Dan Robertson (...) > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include #include > +int bma400_probe(struct device *dev, struct regmap *regmap, const char *name) Even if the component is always powered on in your design please add regulator handling already from start so that we don't have to go in and add it later. I've added regulator support to sooo many IIO drivers by now. You can pretty much just copy/paste my code for BMA180/BMA250: https://lore.kernel.org/linux-iio/20191211213819.14024-2-linus.walleij@linaro.org/T/#u Yours, Linus Walleij