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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 597D7C4332F for ; Thu, 2 Nov 2023 12:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376560AbjKBMiM (ORCPT ); Thu, 2 Nov 2023 08:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376388AbjKBMhs (ORCPT ); Thu, 2 Nov 2023 08:37:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7815B12F; Thu, 2 Nov 2023 05:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698928659; x=1730464659; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=3cx3Gh97q1TI7X7Gi33Q4qSv/X460QUi4X0UkGtWr2A=; b=I9d+gwcw6KyFppLs7PawQpT5gUgLzFwEXwRKzPwKkmj61mRDTT9YwigH JI5b7U2KmVJBi6/54ybnf2EpH6+Ol4kIKISa3w2u0Z9K4nQYtUvMhzxJI xwhBacpy9gmMkHUKavJaoGgV0zW6TOYiQ3W+/Yz1GRmXfhI73US0b9u91 lHVN60tIwKfz2OY7N/Q2hHApZ1QZ5ke1q+y7WEnl2mwbstR6MpdT2Ypwj xmnQ47ZAxtxofdnPSTW0EiOq7SlJdPDyyQb/90fRaHLaALkNTzM3VaHPw OoaTEk1E3apzAGPlmHHY1+Mi1bynSmNbC6lwMDN5a4N+emjH/IOOnBIS4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10881"; a="1627113" X-IronPort-AV: E=Sophos;i="6.03,271,1694761200"; d="scan'208";a="1627113" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2023 05:37:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10881"; a="851904992" X-IronPort-AV: E=Sophos;i="6.03,271,1694761200"; d="scan'208";a="851904992" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2023 05:37:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qyWx4-0000000Agc8-2yzC; Thu, 02 Nov 2023 14:37:34 +0200 Date: Thu, 2 Nov 2023 14:37:34 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Raag Jadav , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg Subject: Re: [PATCH v1 1/1] pinctrl: tangier: Move default strength assignment to a switch-case Message-ID: References: <20231030155340.3468528-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2023 at 02:34:30PM +0200, Andy Shevchenko wrote: > On Thu, Nov 02, 2023 at 08:36:11AM +0100, Linus Walleij wrote: > > On Mon, Oct 30, 2023 at 4:54 PM Andy Shevchenko > > wrote: (...) > > > + case 1: /* Set default strength value in case none is given */ > > > > So where does this 1 come from in the end? That's the piece I > > am missing in this explanation. Somewhere, someone decided > > to pass 1 to indicate "pull to default resistance". > > > > Is it coming from ACPI firmware? > > No, it's pure Linux kernel decision. > gpio_set_bias() is who made that. That's why it needs to be chosen on global > level. > > We may even document somewhere that arguments let's say up to 10 do not make > any sense in real life, as even for 1.2 v it will give 120 mA current on a single > pin. Yet, theoretically that's possible for discrete industrial GPIOs, so we > can choose "very big number" if such case appears in the future. I don't want Just realized that "very big number" is limited to 16-bit value right now and 65 kOhm is quite reasonable value for the pull bias (yet we can use exact 0xffff for the "special" case). > to change 1 to something else right now as it may break things. > > > for default pull" should be added to the constant definition in the > > code. -- With Best Regards, Andy Shevchenko