Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp577103rwb; Fri, 23 Sep 2022 00:46:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YvJbHiQuHqSNvoA5xSX/9tYLg40N5EC0Mys4sYTXc6NxScXB/tYk3+ahUByrVwIuf4Hgk X-Received: by 2002:a17:906:cc56:b0:779:ed37:b59e with SMTP id mm22-20020a170906cc5600b00779ed37b59emr5874029ejb.536.1663919170946; Fri, 23 Sep 2022 00:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663919170; cv=none; d=google.com; s=arc-20160816; b=NdmGsxv5EoTvBCJpw8eblvhcubvMp2sgNCyI9laIhymvP5QStC6QgIO10ocG2eGrMB 1q3YSBe1/uH1z+QO3hLp/BMAgl5RroEy3IbAFOCI55iGwrIPKHZhqEVFoHJizEhwClTS o9tW/H8AePUmL32wceTSDbs2uf9VGLYARlJobVCIh744rgVMtNA9aa825FcmLDN6k2/+ CkgHvqyOzC0vpaxn9EgRm9cfo4Pn9UX/3jlNBjaaDS0xkU0fqVqB6xHq2mSHZ1bGNLzG koXa38PBLngJbmCoiVw0/i41FZR4hohQGJpyW1D6eyKvrpJ504D2YQ98wuI4Uq/SgdPN 2IxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=cO5rS1dpYfCGe3y3g2taPmcXnwSxGvvBdzhaTW2FSK8=; b=eYOBFEmBmBPM/m/ZJZwr3arc+Ah71TWKt8arOUgMOYja46o6IeF+iaLfbXrp+GSiOE PCgXPQD8/z80IZmqzy20j2ZHTanAHHSVLK8v+EAtgmwi5TiPZYGbOMKY4SyhCniq9tYG 4BF8Ub1NAywA32RuYh7X3mpfHAMsU0XreqYSwJBbrOXLX+/1TZRq48cSOiABuW6+T2DP qotJ5zQc1AG2yofwBJv3n1KrZiqabv96lygg+e47FYKWEtjFoIxplPaiubGNcXUEdmi3 qP64Ayathklag+a/dU8vp9f+EclwCoaZslvT4AQwvcH8NcKuH5qamj2iQvZE6buPgVtz Od4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BKsgmxIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a05640235c700b0043dfc949d31si7828072edc.25.2022.09.23.00.45.46; Fri, 23 Sep 2022 00:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BKsgmxIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230472AbiIWHZW (ORCPT + 99 others); Fri, 23 Sep 2022 03:25:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbiIWHZU (ORCPT ); Fri, 23 Sep 2022 03:25:20 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC63A033D; Fri, 23 Sep 2022 00:25:19 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id m3so16757471eda.12; Fri, 23 Sep 2022 00:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=cO5rS1dpYfCGe3y3g2taPmcXnwSxGvvBdzhaTW2FSK8=; b=BKsgmxIELX+6q9foTzuzvmTBZPBXnOfyw7LrzBJx7JaQ0vq4gMQmg4gjXiX7vOxER8 f8CkcZ1hY91ciyDXwPrdCgK2SEPNdOh+ueME2O1tprlON5Q1A7Qiica4Ut63CfIHMYR/ lLrY53pDwmruhnhPfpBJP/EIk2do7XRhrwcnJ8Pc2+1iKkodKB/ZIcRYVhOgheaXOdAw sShkrCaEqqrP9s73g07HyM2wf2kTXYG6sOt74oAp6ts04o5fZmaxlw3+bGibLA9AzVkW 58KsOymczEIpt5Q7Ef2PH9PxetTG6EZl2X84baILzopjXg4XvxpFab7OnYvLz1CqYB6J W7rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=cO5rS1dpYfCGe3y3g2taPmcXnwSxGvvBdzhaTW2FSK8=; b=bG6lrGlqKARtMh0X1iF8S4aS0drvslwKUtL0cmy4e7wFbo9VLlx/s++zR+yq4kar7J 0yVnpCXirzWicDpto4UhSUFchcgVHLZKChiMB/+ToxHTkoHJNxdtBDspBqaKrgzvQsHD LJyZMciDAwqY6d/j1esBe8q2wEz6zcA7xTQolfUua1LcCTvFXvRQdc13nRxWFdqBskk+ 4og/vblrXSHUTwjlxVmgffmOKSExaocuNyxINFB7fS1q/qYhDQKVnY4JB90MD48DDpRf JHtP0djQmbuQSgJbQzIlUbgy1ohN6CPratsCrmFEvRIqhma7HbaXOK0tIjz32x8Vao/B Rqug== X-Gm-Message-State: ACrzQf1yVLTTATkLmIdXWedsWWSgQhSXmM0oecTdhDa1mR3klrnqGbtv +EzyMIgfh4j58DHgHGk6nSlicYiA850gjFfusflczagCBeg= X-Received: by 2002:a50:ea89:0:b0:453:8b7d:12e8 with SMTP id d9-20020a50ea89000000b004538b7d12e8mr7063352edo.148.1663917917718; Fri, 23 Sep 2022 00:25:17 -0700 (PDT) MIME-Version: 1.0 References: <20220907132205.28021-1-andrea.merello@iit.it> <20220907132205.28021-9-andrea.merello@iit.it> <20220918182731.26de1a02@jic23-huawei> In-Reply-To: <20220918182731.26de1a02@jic23-huawei> Reply-To: andrea.merello@gmail.com From: Andrea Merello Date: Fri, 23 Sep 2022 09:25:06 +0200 Message-ID: Subject: Re: [v7 08/14] iio: imu: add Bosch Sensortec BNO055 core driver To: Jonathan Cameron Cc: andrea.merello@iit.it, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, bagasdotme@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il giorno dom 18 set 2022 alle ore 19:27 Jonathan Cameron ha scritto: [...] > > Hi Andrea, > > I think this is looking to be in a good state now. > There is some devm handling for clks now available that should avoid > the need to open code that here. > > I've made that change whilst applying. Please take a look to make sure > I didn't mess it up! Hi, thank you for directly fixing, so that I can avoid a further series version :) I've looked at this change, and it looks good to me; also, I've run some tests and nothing failed. Andrea > Jonathan > > > + > > +static void bno055_clk_disable(void *arg) > > +{ > > + clk_disable_unprepare(arg); > > +} > > + > > +int bno055_probe(struct device *dev, struct regmap *regmap, > > + int xfer_burst_break_thr, bool sw_reset) > > +{ > > ... > > > + priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > > + if (IS_ERR(priv->reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(priv->reset_gpio), "Failed to get reset GPIO\n"); > > + > > + priv->clk = devm_clk_get_optional(dev, "clk"); > > + if (IS_ERR(priv->clk)) > > + return dev_err_probe(dev, PTR_ERR(priv->clk), "Failed to get CLK\n"); > > + > > + ret = clk_prepare_enable(priv->clk); > > + if (ret) > > + return ret; > > + > > + ret = devm_add_action_or_reset(dev, bno055_clk_disable, priv->clk); > > + if (ret) > > + return ret;# > > devm_clk_get_optional_enabled() is now available and should work here I think? > > > + > > + if (priv->reset_gpio) { > > + usleep_range(5000, 10000); > > + gpiod_set_value_cansleep(priv->reset_gpio, 1); > > + usleep_range(650000, 750000); > > + } else if (!sw_reset) { > > + dev_warn(dev, "No usable reset method; IMU may be unreliable\n"); > > + }