From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25ECFC433E1 for ; Tue, 19 May 2020 09:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08445207E8 for ; Tue, 19 May 2020 09:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbgESJV2 (ORCPT ); Tue, 19 May 2020 05:21:28 -0400 Received: from mga14.intel.com ([192.55.52.115]:39871 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgESJV2 (ORCPT ); Tue, 19 May 2020 05:21:28 -0400 IronPort-SDR: F1JZkk9Qj2sEjc2RHdnhqnvift+iDxCWB7zDa7zonajqEgP5KVxZACAkchcJ0MgOLngwh27GZ7 oXaskZS7UF5w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 02:21:27 -0700 IronPort-SDR: uHncHa+/1V+Q/2aBf+8o7XI8OA0oUARElpu9cG6qJK+A5LMD/PkBnP8qXOvFMbchpgAhGlPgRM O2dfpX36FoOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,409,1583222400"; d="scan'208";a="253188831" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007.jf.intel.com with ESMTP; 19 May 2020 02:21:24 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jayRD-007bh4-0v; Tue, 19 May 2020 12:21:27 +0300 Date: Tue, 19 May 2020 12:21:27 +0300 From: Andy Shevchenko To: Jonathan Albrieux Cc: linux-kernel@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Greg Kroah-Hartman , Hartmut Knaack , Jonathan Cameron , Lars-Peter Clausen , Linus Walleij , "open list:IIO SUBSYSTEM AND DRIVERS" , Peter Meerwald-Stadler , Thomas Gleixner , Jonathan Cameron , Jilayne Lovejoy Subject: Re: [PATCH v2 3/3] iio: magnetometer: ak8975: Add gpio reset support Message-ID: <20200519092127.GS1634618@smile.fi.intel.com> References: <20200519065749.4624-1-jonathan.albrieux@gmail.com> <20200519065749.4624-4-jonathan.albrieux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519065749.4624-4-jonathan.albrieux@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 08:57:43AM +0200, Jonathan Albrieux wrote: Thanks for an update, my comments below. > According to AK09911 datasheet, if reset gpio is provided then Trailing whitespace. > deassert reset on ak8975_power_on and assert reset on ak8975_power_off. > > Without reset's deassertion during ak8975_power_on, driver's probe fails on > ak8975_who_i_am while checking for device identity for AK09911 chip > > AK09911 has an active low reset gpio to handle register's reset. > AK09911 datasheed says that, if not used, reset pin should be connected > to VID. This patch emulates this situation Please, put periods at the end of the phrases. > /* > - * According to the datasheet the power supply rise time i 200us > + * According to the datasheet the power supply rise time is 200us > * and the minimum wait time before mode setting is 100us, in > - * total 300 us. Add some margin and say minimum 500us here. > + * total 300us. Add some margin and say minimum 500us here. > */ This is not related change (perhaps, you may do in separate patch), but I'm not against it. Up to maintainer. > + /* > + * According to AK09911 datasheet, if reset gpio is provided then > + * deassert reset on ak8975_power_on and assert reset on > + * ak8975_power_off. We try to refer to the code accordingly to the kernel doc recommendations (even for non-kdoc comments). So, here, 'function' as 'function()' (without quotes) and so on. > + */ > + reset_gpiod = devm_gpiod_get_optional(&client->dev, > + "reset", GPIOD_OUT_HIGH); > + if (IS_ERR(reset_gpiod)) > + return PTR_ERR(reset_gpiod); > + > /* Register with IIO */ > indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); > if (indio_dev == NULL) > @@ -866,6 +883,7 @@ static int ak8975_probe(struct i2c_client *client, > > data->client = client; > data->eoc_gpiod = eoc_gpiod; > + data->reset_gpiod = reset_gpiod; > data->eoc_irq = 0; > > err = iio_read_mount_matrix(&client->dev, "mount-matrix", &data->orientation); > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko