Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2883888pxa; Mon, 17 Aug 2020 23:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztuL7qm35lCDt83oTap2f3s9ldp45pNfZikMr8lvc1JQQ9s8TKQn9mrBfMHh04j58uxcDa X-Received: by 2002:a17:906:4a07:: with SMTP id w7mr18139812eju.269.1597733929728; Mon, 17 Aug 2020 23:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597733929; cv=none; d=google.com; s=arc-20160816; b=0jh22a4BbLm2z4Fr3NY58DfbRQJSrz7MYg+pnh+vLBIHk+YIseL0RwIVP9EWGe7Pyg TSZGC4nwtwOlNwk/RFapP5vPHOCA0B/PCFj+/Mkgeeb3lii6HZ8znsYUP4IDaWzkp4+Y jKbOEIuq4j0Z1RnbtmD/DYVfkxayelAA8zFOLsFIYplSWoRjW38TQaio8BgJ4ezU8bED T3OnNeoCi/4893RdEpW75QBh1pKUYsZJXAlhdSlsvFgolfaPaZr3Er6TckwnkBHDlb9C h4JDmSJKrXPB6Q5ZGbk12ySYyVzbBy4jPcZuELAt90Z3qvY/WTzxd94wHT9DgGBKDORG WzIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=OzYV8DfQeMnpe3Vb5o5CUILaV658G6JNPNDUJSO4uP8=; b=P95NqB0ZXZ6ALcbTL2c+68Ul0HMaYKht2cnIZFqWJz79fziOeTTSCFjefkzWHYQwcs 9JIN1lyulk75i96TljD2xHT5B+g9PFn8kjAsg6jwJKvRFZLAJ5IXFQfRNQRMjxiPEJ// WALj62QUt/OinQkEEBNVbh8uST8dIjOS4rv7hfu9meALm+59p5/B582dJABsLfM9awcY 3gX9uBcoqePKOezcLLxOPI6UxWugdG7FxporjD4W64iS7BbuUCFsDDqUriZo2hlMptcf dtb04hmLVUKELEgSMxfBLPSQ+MIcutgjRRJy8qy8lA09Fy2kOXcULfAOpfKcZX4z8/6o uH8g== 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si14084334ejm.717.2020.08.17.23.58.22; Mon, 17 Aug 2020 23:58:49 -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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgHRG5k (ORCPT + 99 others); Tue, 18 Aug 2020 02:57:40 -0400 Received: from mga02.intel.com ([134.134.136.20]:31352 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbgHRG5j (ORCPT ); Tue, 18 Aug 2020 02:57:39 -0400 IronPort-SDR: +OryprafOCF446+iOYwZ+Zj1qbTozyAZvZ0LHB7wdiHuIhwB7wCiiBZOPjmfhinI3ZrbS/z60D ZAxl1mzAH9yg== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="142681403" X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="142681403" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 23:57:37 -0700 IronPort-SDR: l7r6WZyWleDq9Xz+CR0fP2uA6pyQZ6R6cVAQg4Ipb+/XTj1TZaWqFWdZcp1wNk5nLAsZgcmRTY uHFbdBVoj7Yg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="336530424" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga007.jf.intel.com with ESMTP; 17 Aug 2020 23:57:35 -0700 From: "Ramuthevar,Vadivel MuruganX" To: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com Cc: andriy.shevchenko@intel.com, thomas.langer@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v1 2/9] extcon: extcon-ptn5150: Switch to GENMASK() for VBUS detection macro Date: Tue, 18 Aug 2020 14:57:20 +0800 Message-Id: <20200818065727.50520-3-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan Switch to GENMASK() for VBUS detection macro. Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/extcon/extcon-ptn5150.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c index 5d9a8767646b..c816a6c1e05c 100644 --- a/drivers/extcon/extcon-ptn5150.c +++ b/drivers/extcon/extcon-ptn5150.c @@ -42,9 +42,7 @@ enum ptn5150_reg { #define PTN5150_REG_CC_PORT_ATTACHMENT_MASK \ (0x7 << PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT) -#define PTN5150_REG_CC_VBUS_DETECTION_SHIFT 7 -#define PTN5150_REG_CC_VBUS_DETECTION_MASK \ - (0x1 << PTN5150_REG_CC_VBUS_DETECTION_SHIFT) +#define PTN5150_REG_CC_VBUS_DETECTION BIT(7) #define PTN5150_REG_INT_CABLE_ATTACH_SHIFT 0 #define PTN5150_REG_INT_CABLE_ATTACH_MASK \ @@ -130,9 +128,8 @@ static void ptn5150_irq_work(struct work_struct *work) case PTN5150_UFP_ATTACHED: extcon_set_state_sync(info->edev, EXTCON_USB, false); - vbus = ((reg_data & - PTN5150_REG_CC_VBUS_DETECTION_MASK) >> - PTN5150_REG_CC_VBUS_DETECTION_SHIFT); + vbus = FIELD_GET(PTN5150_REG_CC_VBUS_DETECTION, + reg_data); if (vbus) gpiod_set_value(info->vbus_gpiod, 0); else -- 2.11.0