Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1085656rdh; Fri, 27 Oct 2023 04:33:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOUZLZG0aiOemImL6HhQaNHCXru5/6HSp3BW95vxAaWrQ7/fHE+GOSE5X3QaLHd1EkmonS X-Received: by 2002:a81:ad5d:0:b0:5a7:c906:14f with SMTP id l29-20020a81ad5d000000b005a7c906014fmr2244780ywk.11.1698406393240; Fri, 27 Oct 2023 04:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698406393; cv=none; d=google.com; s=arc-20160816; b=Fq+ciRND5yYUhSl4zRAnVywfLcyuLPKLyswf7Me3KbtiejUygRL+kEtNrxe8d7z39t 6dV6GGnBwZTa7p5HYHeDY3PNUEX7W23m8Nl4cZSY40kRhXRF38+uEHPkFaxak1RBxIXM AuldDTZx7gHgtGNgVJmjIEgwd6N5id4MavgEAtdz9aiYFHln8QmpCx1Yxs5LRgSaXW91 n2KLm6hFN8tQOwB+rluc+IyQAvTkDkdX5vZtOCwgAblv1WrrPDhj+m+lPWzg1bf0Dqt6 ArknGH+fqwh6Jnka7Ko/l9+cleEyhM9/uB0YVfM6jnaao58H8826VvtD/tUYzbHU0ZIK D5nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3tAmogoDdorRFnZwcz0TBUp0jWv+VONakLqwdpZzrrs=; fh=0dfSBSkrpfhdvwmy97gQ6MhpJu2TYy9nuG6mNWfyoVA=; b=LzkfEEQ24MsVC4YZ/CavR4io3efCeEXrboSqv3zvlnUSS30rNRhHZZ7aXtcUPLCA/D +aVKeqaSA48zaIVxddD8vy4MiOLsdwchNdvQj4VSHbQVu1c3TO7xkgDyI81iVHsIQ+PJ YRYrJQqVRqqLGYI3bukAREJ6h2z2eIpXJQyuP7muR5PNY4K2qyyYYLEXpgE1Vhd93ik9 5AioeCyzaBm6DAMHpPeMgPQ+EHRfO1kFNuhSD6kkwDPaMWsjVj9G5NDUth6ygYEk4GTG Jk7SLZoniSflbGJOPwCmeZJq0vAzWQcahwOh4Up7zM9Wh/jGpSy39AOEgW2zOG//JOGk OPOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hrGvThSg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i74-20020a0ddf4d000000b005a7e596a050si2111605ywe.114.2023.10.27.04.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 04:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hrGvThSg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 540E1836509B; Fri, 27 Oct 2023 04:33:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbjJ0LdC (ORCPT + 99 others); Fri, 27 Oct 2023 07:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbjJ0LdB (ORCPT ); Fri, 27 Oct 2023 07:33:01 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74FAD1B3; Fri, 27 Oct 2023 04:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698406379; x=1729942379; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OApmSqXXZbIaoiJzOhkxdZnJfAMT4marLH+AGdbwU0U=; b=hrGvThSgf5j0kiHxvHzeJLH2MLAX+tT4BhPJsDaDIOQPVbIa/yvc6x49 2ri7Jl2XyePxQVXKzjKTFSFN41D2WmZo4NBn1dsX7ZDozDm/80aacqytU LWvfi+XLvYI+2XiedIQm6s9OcRe1CQQa6O28nvQJw+6O22skolcPNc6fj DqA/7mRX6ORkdx+xBPD383mABo5C6ZxnCKRNtOC2PB282dJSBLiKgMXJe wjz1TndIgZK4/WeVQW7fAytnnmfRj5I+Z+yASljb6kt50J5aIz5tPDRG2 vRi21ZWX+CVpyR3jtSWgBnRXujIoJ1sb0vKeFjrL1mgRPO3yBG0bLLfI+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="451997562" X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="451997562" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 04:32:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="883160448" X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="883160448" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 04:32:56 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qwL5B-000000098Aj-35H6; Fri, 27 Oct 2023 14:32:53 +0300 Date: Fri, 27 Oct 2023 14:32:53 +0300 From: Andy Shevchenko To: Linhua Xu Cc: Linus Walleij , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, lh xu , Zhirong Qiu , Xiongpeng Wu Subject: Re: [PATCH V3 2/6] pinctrl: sprd: Fix the incorrect mask and shift definition Message-ID: References: <20231027071426.17724-1-Linhua.xu@unisoc.com> <20231027071426.17724-3-Linhua.xu@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027071426.17724-3-Linhua.xu@unisoc.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 04:33:10 -0700 (PDT) On Fri, Oct 27, 2023 at 03:14:22PM +0800, Linhua Xu wrote: > From: Linhua Xu > > Pull-up and pull-down are mutually exclusive. When setting one of them, > the bit of the other needs to be clear. Now, there are cases where pull-up > and pull-down are set at the same time in the code, thus fix them. ... > Fixes:<1fb4b907e808> ("pinctrl: sprd: Add Spreadtrum pin control driver") > > Signed-off-by: Linhua Xu Same comment about the Fixes: tag. ... > -#define SLEEP_PULL_DOWN_MASK 0x1 > +#define SLEEP_PULL_DOWN_MASK GENMASK(1, 0) > #define SLEEP_PULL_DOWN_SHIFT 2 No, this is an incorrect (prone to errors and confusion) change. You need to introduce new mask for both of them and use in the code. #define SLEEP_PULL_UP_DOWN_MASK GENMASK(1, 0) #define SLEEP_PULL_UP_DOWN_SHIFT 2 ... > -#define PULL_DOWN_MASK 0x1 > +#define PULL_DOWN_MASK (GENMASK(1, 0) | BIT(6)) > #define PULL_DOWN_SHIFT 6 Ditto. #define PULL_UP_DOWN_MASK (GENMASK(1, 0) | BIT(6)) #define PULL_UP_DOWN_SHIFT 6 -- With Best Regards, Andy Shevchenko