Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp723677imm; Thu, 13 Sep 2018 06:51:38 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb0FDv6I/5cx8+IQmtYrxszbBxhBqtfKqyKeK5YBVIGeoK1H5DJghaUmYSEQ73frnyozkmo X-Received: by 2002:a17:902:4403:: with SMTP id k3-v6mr7328530pld.243.1536846698007; Thu, 13 Sep 2018 06:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846697; cv=none; d=google.com; s=arc-20160816; b=CUsgE+Oefny0fmMFWUpWsuv1N8AzsKiLQn1677Vjyr0OmbHfjbBFc+ztxiwIFVgVcV FPfSfBPcS8XHpy77Prh9wraQ6O65gZ4ASRdawKQqm1NgEbMOgpIoaOu91pJOn+BlOc30 JRn/5TjfBPFbGn1S1bndAklNcokdYMh+cw63+lDgz0XLiHzZymAGWjcIDdE+j9onXX2u GyYfIu40CZGXvqMQs4AaFHB9zgmT5nZrK7G10TnjUa88qn+NmoMeATbtNeaL37xVZ6uc w+KAx224ChBc3hlr8U5pihb8ZT7wqiBdwRpMXFB03XQYTheFXJzgg+fJAZnm4/p52zi1 BcJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=KGJ0mCH7ZiOHOfjLovzKwaX2qbyXT1Cnn6b5YuS5vuU=; b=zhPEg08Wk5sKFCy2QTSUlgjQYg2OctIMGjoRH4a/m2A7VdPEyeFCoNG+DVQERx6lYx gjFQjWz0f74MWYZtfuZUyHsUle5G+55rpPJWDnvmHMf0BLZlsCFCbclmYapScn2L/Bv0 JJDDN4nljZDfcClFK5GFYdqwTE988Tm5UUhrZrclvuiYjTNFG28llhIPtOyO6jNUpRC2 YW+D7O6B/D1A1AvodWrgETFR5hXBXMR7QY5SkUwJwM3ywUN2zrjRMZVnAF1wrd+9bYzh hUWJ0HXOTff9Fu5gc7qcFOODYe93y626qIVrrLFhtZsm/ID6nU/3QiZCbi/P21wALOp/ /OVw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n16-v6si4633223pgl.508.2018.09.13.06.51.22; Thu, 13 Sep 2018 06:51:37 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730763AbeIMTAd (ORCPT + 99 others); Thu, 13 Sep 2018 15:00:33 -0400 Received: from mga02.intel.com ([134.134.136.20]:20559 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728484AbeIMTAc (ORCPT ); Thu, 13 Sep 2018 15:00:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2018 06:50:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,369,1531810800"; d="scan'208";a="89706405" Received: from mylly.fi.intel.com (HELO [10.237.72.64]) ([10.237.72.64]) by fmsmga001.fm.intel.com with ESMTP; 13 Sep 2018 06:50:30 -0700 Subject: Re: [PATCH v2] i2c: designware: select gpio/default pin when prepare/unprepare recovery To: Jisheng Zhang , Andy Shevchenko , Mika Westerberg , Wolfram Sang Cc: linux-arm-kernel , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180913162132.17c9c2b3@xhacker.debian> From: Jarkko Nikula Message-ID: Date: Thu, 13 Sep 2018 16:50:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180913162132.17c9c2b3@xhacker.debian> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2018 11:21 AM, Jisheng Zhang wrote: > On some platforms, the sda/scl pins are muxed with gpio functions, so > they could be used for recovery. Select the gpio/default pin function > when prepare/unprepare recovery. > > Signed-off-by: Jisheng Zhang > --- > > since v1: > - use IS_ERR_OR_NULL > > drivers/i2c/busses/i2c-designware-core.h | 3 +++ > drivers/i2c/busses/i2c-designware-master.c | 22 ++++++++++++++++++++++ > 2 files changed, 25 insertions(+) > ... > + pinctrl = devm_pinctrl_get(dev->dev); > + if (PTR_ERR(pinctrl) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + if (!IS_ERR_OR_NULL(pinctrl)) { > + dev->pinctrl = pinctrl; > + s = pinctrl_lookup_state(pinctrl, PINCTRL_STATE_DEFAULT); > + if (!IS_ERR_OR_NULL(s)) > + dev->pins_default = s; > + s = pinctrl_lookup_state(pinctrl, "gpio"); > + if (!IS_ERR_OR_NULL(s)) > + dev->pins_gpio = s; > + } > + Should these be documented in Documentation/devicetree/bindings/i2c/i2c-designware.txt? -- Jarkko