Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2864575ybk; Mon, 18 May 2020 09:45:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/UjHM6MlhuNxKnOwvZNppyPECSI2r7fpG9Zg4oudWV9mFJwiHcCR2jb4j5gV/qRE7xy1V X-Received: by 2002:a17:906:c401:: with SMTP id u1mr15117020ejz.151.1589820324509; Mon, 18 May 2020 09:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589820324; cv=none; d=google.com; s=arc-20160816; b=HYzfkubqxKwXUyLtVggJJxs0m2BAn8FRpBg/zwru6Sk8kutCAoAjcyszHeu4jhbJ9g g0z2+YZnq/x8LxDT+F2raZMKwAuhrOiqrujsuzvSTwwq11t539Hh9O/SB2AgFL1iMmLX 4H6aYx9sbAjAtO6Kk/ULhP/jTYyAXwpAHSM9G8kHEPgH8eebHKNXum6zjtCQmb+sm2lQ 67mvUU02RqxPcIMrgiME7xB0yYkcJUoWO9Cvp0GzbHfO+SqHUiVZd8wNqtJ1i0a+DAb2 otXulbKrSmY3ZijrDV4Cg+OeOxWk0OjSquvIqfNbsHUBu8d4XZuYUNmuy9b1vYxHckbh m6yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=Shq5BDE//V6m3hgWZE7zFK4CaMwJLo7Fr8H33yfhJMM=; b=RnczAhRLYCEmI/C7n/PM5GafjPtbDz06NVDtKrmO2rfajtGqdwc58wqSZiMYycpHqI nY8A9X3Ryado3AKrBTVbTKg+FWYQ8CwrSh45pDyHoxy7pDZLeQRl7FQIwjxRcW5WoKaC 1qfi+0ZFtX07+tQy7aZ5p7YNBMIIPx1ekdu5kG4sjZ1TVvGC+gXVaREoRtrMsyXGRJPI KcgjYjBOjfpUTEKx10+uR2R1y/KZzPVv1uYTzBRBgCVDX5A8VXmww5Yp/LbThmwsrwV8 1Cdft2EDTCM2FlMpD0hFiZ7m36c93jOyOxq84Av8XKLvCFG+ZZgtJKft1/DfCFawdlKW tR4w== 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a26si6613552edb.163.2020.05.18.09.45.01; Mon, 18 May 2020 09:45:24 -0700 (PDT) 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728420AbgERQnU (ORCPT + 99 others); Mon, 18 May 2020 12:43:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:48761 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbgERQnU (ORCPT ); Mon, 18 May 2020 12:43:20 -0400 IronPort-SDR: 0AHFgMZphkospxMAbe/8lyswVtAI8SxiTNhvSVk+vNF7UzvxfHM/xEx0CfgBVIOfCcBdLXd2OR ZwVnfPt1ZdEg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 09:43:18 -0700 IronPort-SDR: upDKlvNwBdsY1JUgaGgn7G2U8VVN5G1yPIetYSweB5w8b5sStOSfgYfh5535yban1X6ROWpjOW Nd09R8pnrSMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,407,1583222400"; d="scan'208";a="288632001" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 18 May 2020 09:43:15 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jairF-007TA1-UP; Mon, 18 May 2020 19:43:17 +0300 Date: Mon, 18 May 2020 19:43:17 +0300 From: Andy Shevchenko To: Jonathan Albrieux Cc: Linux Kernel Mailing List , "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 , Steve Winslow , Thomas Gleixner , Jonathan Cameron Subject: Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support Message-ID: <20200518164317.GL1634618@smile.fi.intel.com> References: <20200518133645.19127-1-jonathan.albrieux@gmail.com> <20200518133645.19127-4-jonathan.albrieux@gmail.com> <20200518160120.GA21361@ict14-OptiPlex-980> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200518160120.GA21361@ict14-OptiPlex-980> 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 Mon, May 18, 2020 at 06:01:20PM +0200, Jonathan Albrieux wrote: > On Mon, May 18, 2020 at 05:55:51PM +0300, Andy Shevchenko wrote: > > On Mon, May 18, 2020 at 4:38 PM Jonathan Albrieux > > wrote: > > > > > + gpiod_set_value_cansleep(data->reset_gpiod, 1); > > > > (1) > > > > ... > > > > > + /* > > > + * If reset pin is provided then will be set to high on power on > > > + * and to low on power off according to AK09911 datasheet > > > + */ > > > > Wording is confusing, perhaps you have to use 'asserted / deasserted'. > > Thank you for the suggestion, I'll be working on rewording as soon as > possible. > > > Btw, in (1) it's also "high" (asserted). I barely understand how it's > > supposed to work in all cases? > > > > > + reset_gpiod = devm_gpiod_get_optional(&client->dev, > > > + "reset", GPIOD_OUT_HIGH); > > > + if (IS_ERR(reset_gpiod)) > > > + return PTR_ERR(reset_gpiod); > > > > I'm sorry but I'm not sure about what you mean by saying all cases. > Currently I'm testing this driver on a msm8916 device having AK09911 > magnetometer. At the current stage the driver is failing on probe > because reset pin is not connected to VID (as datasheet requires in case > of pin not being used). In case of reset pin not asserted, register's > reset is triggered resulting in empty registers, leading to probe fail. > For this reason pin is asserted during power on in order to have > informations in registers and deasserted before power off triggering > a reset. > > A workaround that gets AK09911 working on device is by setting the > reset pin always high on device tree. This way registers gets reset by > a Power On Reset circuit autonomously and reset pin never triggers the > reset. You need to distinguish electrical level from logical (GPIO flag defines logical). So, I'm talking about active-high vs. active-low case. Now I re-read above, and see that here you assert the reset signal. But where is desertion? -- With Best Regards, Andy Shevchenko