From patchwork Tue Jul 21 14:49:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abanoub Sameh X-Patchwork-Id: 1333083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DnwDwXp4; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB1j55hT0z9sR4 for ; Wed, 22 Jul 2020 00:50:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728156AbgGUOuB (ORCPT ); Tue, 21 Jul 2020 10:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbgGUOuA (ORCPT ); Tue, 21 Jul 2020 10:50:00 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF0DFC061794; Tue, 21 Jul 2020 07:49:59 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z15so21464210wrl.8; Tue, 21 Jul 2020 07:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cZetXmbyWOvYbaVmJBjZ5gofoHIdQ4s4qUgojNYE0NQ=; b=DnwDwXp4wL6zVNDnjCGyaDNgMco25mow4mMGKMYYhdsDg3IMlTbW4JpAI9dkVUMuRH cYvHsG/iKx9pnDUlkZclECjcqeRGyGemQzE2oxp7Mba5edjQ9SapscM5aDESEC2c43mI 7ugAj0HF4Z8VMjH+wnt/TfoSoWts/hYFeQI49JZZbhroBQI7UrAl/zR4pe0oRZI/b2dt ZGislyjgmUeXRYWcsw3TEhkKPYyg5BWwt0NiANdn8jEHvO37OLNSuqKMsgGRb8YcHK+r D3U52VBZKQRI8iBchD28z+ug6/15blHAYYU+VTQF70CY3Y+U/hZRrvXqvE+mSgvf4wyi sbUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cZetXmbyWOvYbaVmJBjZ5gofoHIdQ4s4qUgojNYE0NQ=; b=QgNl9ydKuudpQLKZYqPXN1nfu92bNGZZ4huQ1I3tHznWhyy5pUGJcB+A9Lzr2BFwb/ ZF2PP1gLbTYgXMoKOoeBfWAx/3X6YBQ1qOBMeLu1caclurhvI3zPvHZtWnmdW48aHDTG Kv7Qc1IYPjA/1Q8Z2L2zb4AA5jfwtcxqROtiGP2wQGRVsA2Tk5mk6Hgh7HKS6KJpuNl3 bjiYG8CSfhtn7jIYgJZX5qy/Vl7M4qLhJD5vcLi56n8mm05eqOn9WooA/eFNfOh65kUs /R53jfKTfUD2c4TTj4KRcKaPnKuBho5o7UW4Aynul6g6TcpFjls2gYbpaZOrn4s4ImUN YqlA== X-Gm-Message-State: AOAM532GAeMe3dDeALAjB45W0pQAfHYnUJxx5vAoE5GWPpL0tyQ+f9dz sPQktILSvBhE3EprXxfNYGM= X-Google-Smtp-Source: ABdhPJxMlO7SX2mv21SVZrwacERp2Kn6/XeGsafSLImZ7lHVv9gtHqxOM9idG4VV2/3723aVn0bIeA== X-Received: by 2002:adf:fb06:: with SMTP id c6mr2161007wrr.261.1595342998675; Tue, 21 Jul 2020 07:49:58 -0700 (PDT) Received: from localhost ([156.204.74.63]) by smtp.gmail.com with ESMTPSA id n189sm3239334wmf.38.2020.07.21.07.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 07:49:58 -0700 (PDT) From: Abanoub Sameh X-Google-Original-From: Abanoub Sameh To: andy.shevchenko@gmail.com Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Abanoub Sameh Subject: [PATCH 1/3] gpio: gpio-intel-mid.c: changed every 'unsigned' to 'unsigned int' Date: Tue, 21 Jul 2020 16:49:40 +0200 Message-Id: <20200721144942.762495-1-abanoubsameh@protonmail.com> X-Mailer: git-send-email 2.28.0.rc0 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Changed 'unsigned' to 'unsigned int'. This makes the code more uniform, and compliant with the kernel coding style. Signed-off-by: Abanoub Sameh --- drivers/gpio/gpio-intel-mid.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c index 86a10c808ef6..6487acab104c 100644 --- a/drivers/gpio/gpio-intel-mid.c +++ b/drivers/gpio/gpio-intel-mid.c @@ -64,27 +64,27 @@ struct intel_mid_gpio { struct pci_dev *pdev; }; -static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset, +static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned int offset, enum GPIO_REG reg_type) { struct intel_mid_gpio *priv = gpiochip_get_data(chip); - unsigned nreg = chip->ngpio / 32; + unsigned int nreg = chip->ngpio / 32; u8 reg = offset / 32; return priv->reg_base + reg_type * nreg * 4 + reg * 4; } -static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset, +static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned int offset, enum GPIO_REG reg_type) { struct intel_mid_gpio *priv = gpiochip_get_data(chip); - unsigned nreg = chip->ngpio / 32; + unsigned int nreg = chip->ngpio / 32; u8 reg = offset / 16; return priv->reg_base + reg_type * nreg * 4 + reg * 4; } -static int intel_gpio_request(struct gpio_chip *chip, unsigned offset) +static int intel_gpio_request(struct gpio_chip *chip, unsigned int offset) { void __iomem *gafr = gpio_reg_2bit(chip, offset, GAFR); u32 value = readl(gafr); @@ -97,14 +97,14 @@ static int intel_gpio_request(struct gpio_chip *chip, unsigned offset) return 0; } -static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) +static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset) { void __iomem *gplr = gpio_reg(chip, offset, GPLR); return !!(readl(gplr) & BIT(offset % 32)); } -static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) +static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { void __iomem *gpsr, *gpcr; @@ -117,7 +117,7 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) } } -static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) +static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) { struct intel_mid_gpio *priv = gpiochip_get_data(chip); void __iomem *gpdr = gpio_reg(chip, offset, GPDR); @@ -140,7 +140,7 @@ static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) } static int intel_gpio_direction_output(struct gpio_chip *chip, - unsigned offset, int value) + unsigned int offset, int value) { struct intel_mid_gpio *priv = gpiochip_get_data(chip); void __iomem *gpdr = gpio_reg(chip, offset, GPDR); @@ -163,7 +163,7 @@ static int intel_gpio_direction_output(struct gpio_chip *chip, return 0; } -static int intel_mid_irq_type(struct irq_data *d, unsigned type) +static int intel_mid_irq_type(struct irq_data *d, unsigned int type) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct intel_mid_gpio *priv = gpiochip_get_data(gc); @@ -297,7 +297,7 @@ static int intel_mid_irq_init_hw(struct gpio_chip *chip) { struct intel_mid_gpio *priv = gpiochip_get_data(chip); void __iomem *reg; - unsigned base; + unsigned int base; for (base = 0; base < priv->chip.ngpio; base += 32) { /* Clear the rising-edge detect register */ From patchwork Tue Jul 21 14:49:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abanoub Sameh X-Patchwork-Id: 1333085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RBF70gWL; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB1jL4t67z9sSJ for ; Wed, 22 Jul 2020 00:50:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729626AbgGUOuE (ORCPT ); Tue, 21 Jul 2020 10:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbgGUOuD (ORCPT ); Tue, 21 Jul 2020 10:50:03 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 602EAC061794; Tue, 21 Jul 2020 07:50:03 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id f18so3165111wml.3; Tue, 21 Jul 2020 07:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2jvq9FlI7o6al7hU8EUdIg9paAzP+PBPHlRfqRi6w1Y=; b=RBF70gWLPXsqqv76vGFtmcQeh6GucMxg5VYzF4jXuWum4Doiqpw/wQ9x4tffRbEUVl G2YMe+nWm/8+b/tiKxH0tggVmvo59QGbCJqpU46cW62kIoKRPtKsY/Kxsva5n5vXXPPi ViGBWMjvN26srjdybnuhvQhmL9Nv3tviLguWA1iorAEbOTwPQi3L9IBA61QqXu5PH+O8 Jrq0QM9IDDp9MBlA2JchB4Hi5VSG3i4856uW0cxiAGsYsnX1xU/kKCgc4vcPTwQmdsAN puUX1RkBJVHyNv6hPRgpF3Je5mgEgyvC6MC4Vcj+FmD4RSMohh8OT7Ndt6qfwi2ILsUN 2xsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2jvq9FlI7o6al7hU8EUdIg9paAzP+PBPHlRfqRi6w1Y=; b=ULj99MIiwfRYo1DV61YwFKqKGC84Fc7PFAacNm4SvsiNRbcmo/yocQf24vUcQjIK1/ +zY+25Fsv5tCrn/fNdl6Ec7vrdAiIdRvl4RBbGTJZgyfmN3fH1/+QMPe642Flc3XGf3R OsJFRDyjypjeBKE6u4s0+HgxSi6GD23unQFPOGvUO2Nb/jkKWjJFZRCFNwFpOoheUu+W DFJc7KxnSEbu0y4kR1NbAq58b8C+rlgUQkavxJh+CprwWSh87PklLY5jZ7oOnA54Pvi8 IdMDpVhl4K6rtOC4MtiDcJZZkpGX+bioF5sOrOWANivfnitEmWCuO8fAp3Ij8NHhvnZk n9ZQ== X-Gm-Message-State: AOAM532NJvSBn7S2R2XHg3g3oyPYA8XiqedirM4pZwF/7jxopPKdTxp3 PTc8mVYttz9wkWoQfO++AGc= X-Google-Smtp-Source: ABdhPJyQqu0IWAETiEuW9l6a3Jvb0jlAejO9q2crcSjo5oVGJTVo6Onjy9gcQumMvOWEh6MKiRbjpg== X-Received: by 2002:a1c:286:: with SMTP id 128mr3758578wmc.37.1595343001183; Tue, 21 Jul 2020 07:50:01 -0700 (PDT) Received: from localhost ([156.204.74.63]) by smtp.gmail.com with ESMTPSA id e23sm3571741wme.35.2020.07.21.07.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 07:50:00 -0700 (PDT) From: Abanoub Sameh X-Google-Original-From: Abanoub Sameh To: andy.shevchenko@gmail.com Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Abanoub Sameh Subject: [PATCH 2/3] gpio: gpio-intel-mid.c: fixed alignment of a block comment Date: Tue, 21 Jul 2020 16:49:41 +0200 Message-Id: <20200721144942.762495-2-abanoubsameh@protonmail.com> X-Mailer: git-send-email 2.28.0.rc0 In-Reply-To: <20200721144942.762495-1-abanoubsameh@protonmail.com> References: <20200721144942.762495-1-abanoubsameh@protonmail.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org A small to the coding style of a comment to make it compliant with the coding style. Signed-off-by: Abanoub Sameh --- drivers/gpio/gpio-intel-mid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c index 6487acab104c..a9cef06b813b 100644 --- a/drivers/gpio/gpio-intel-mid.c +++ b/drivers/gpio/gpio-intel-mid.c @@ -38,7 +38,7 @@ * reg_addr = reg_base + GPDR * nreg * 4 + reg * 4; * * so the bit of reg_addr is to control pin offset's GPDR feature -*/ + */ enum GPIO_REG { GPLR = 0, /* pin level read-only */ From patchwork Tue Jul 21 14:49:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abanoub Sameh X-Patchwork-Id: 1333084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TMjyC4rk; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB1jF6sHYz9sRk for ; Wed, 22 Jul 2020 00:50:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728934AbgGUOuF (ORCPT ); Tue, 21 Jul 2020 10:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbgGUOuF (ORCPT ); Tue, 21 Jul 2020 10:50:05 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D438AC061794; Tue, 21 Jul 2020 07:50:04 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id g10so2365367wmc.1; Tue, 21 Jul 2020 07:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NuxS/YlfNn8XyS7GkKomUpEyuCciWXzwunr2ZyS2ffE=; b=TMjyC4rkQ7A9UkLFTzOsSS7dB0U1VDYV5OCNuXrbRnYJ+H5fUYIMzY4ZOfgeZz+aEi sgt0wVSQP/YPp5E+cY0vRnHlKe2ej0sZQYExDDnwrekw27ViEZiKqTdlrvdvnp4nWNbE AS93NYy5x6/AagGBCUizhDHLWQMmkclpRkPp1rYLPpDB/xIy2jDKYRnISuyCNir7k77E QpldJjvx2Ic3CDWPiJJFN/vOw8zz/FQG5uAbzcWL8nHub9OjcmilscqfpN1U3j4wvMRO MzIjGSutz143lYEQqrSW2LkquC5mOIY7x/xD8TFjmrULqw7hdVVHmppfUIroWxeLdTp/ 8qVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NuxS/YlfNn8XyS7GkKomUpEyuCciWXzwunr2ZyS2ffE=; b=YqvcQNo8H6vXAYBl5gqPRR+YAb/FOfQPJoAQrLkCybVJ7yog4wgQ6tUBgF+KNTN3HX wiBW69beerxgMcKJN7Wb6Pk14Hsfm2fGcPVGJ0QSeRdbp4cvsNwYLY627V9TQ8NxFkRd QzwouuO2ax9YgJna4nh/S1j0QHMAJZUtnTtBXThDLa1zB/Sd/2QopEJZs9Lp4eDw3p2f s718r5x5lR62Fx5g3D2nbPvgfUGDukO8nPBN6VoHoWKy0lfupeMB/YNv3fPh4N+fv+cS /HTb7B4W4SUARP2U9NUNR9j2ZADl1gu4O0jHcgucwOFwTIPv1Uomkx04Yv2tIS1/K82m Qjag== X-Gm-Message-State: AOAM532JYvrjLSDxLNrSe0KPz4SEbQp7axTHMEZuOq2XQCe0N4QXqB8v v+/1HbJKGegqOxUgH1NYcqs= X-Google-Smtp-Source: ABdhPJx1xXfMScCwSaM58Uzr5nx1URk2yPaXj7rE3vbvRn94MBs6hCl3bPq+8AqxbZEn++hbcbOwNw== X-Received: by 2002:a1c:a993:: with SMTP id s141mr4570847wme.174.1595343003483; Tue, 21 Jul 2020 07:50:03 -0700 (PDT) Received: from localhost ([156.204.74.63]) by smtp.gmail.com with ESMTPSA id l15sm36605788wro.33.2020.07.21.07.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 07:50:03 -0700 (PDT) From: Abanoub Sameh X-Google-Original-From: Abanoub Sameh To: andy.shevchenko@gmail.com Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Abanoub Sameh Subject: [PATCH 3/3] gpio: gpio-intel-mid.c: fixed a coding style issue Date: Tue, 21 Jul 2020 16:49:42 +0200 Message-Id: <20200721144942.762495-3-abanoubsameh@protonmail.com> X-Mailer: git-send-email 2.28.0.rc0 In-Reply-To: <20200721144942.762495-1-abanoubsameh@protonmail.com> References: <20200721144942.762495-1-abanoubsameh@protonmail.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Added an empty line after a declaration to fix a coding style issue. Signed-off-by: Abanoub Sameh --- drivers/gpio/gpio-intel-mid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c index a9cef06b813b..a609964645c1 100644 --- a/drivers/gpio/gpio-intel-mid.c +++ b/drivers/gpio/gpio-intel-mid.c @@ -317,6 +317,7 @@ static int intel_mid_irq_init_hw(struct gpio_chip *chip) static int __maybe_unused intel_gpio_runtime_idle(struct device *dev) { int err = pm_schedule_suspend(dev, 500); + return err ?: -EBUSY; }