All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashish Jangam <ashish.jangam@kpitcummins.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Dajun <dajun.chen@diasemi.com>
Subject: Re: linux-next: build failure after merge of the regmap tree
Date: Thu, 15 Dec 2011 14:55:46 +0530	[thread overview]
Message-ID: <1323941146.32031.49.camel@dhruva> (raw)
In-Reply-To: <C3AE124F08223B42BC95AEB82F0F6CED1F9D0895@KCHJEXMB01.kpit.com>

Fixes DA9052 GPIO errors.

This patch is functionally tested on Samsung SMDKV6410.

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
---
 drivers/gpio/gpio-da9052.c      |   37 ++++--------------------------
 include/linux/mfd/da9052/gpio.h |   48 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 32 deletions(-)
 create mode 100644 include/linux/mfd/da9052/gpio.h
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index 038f5eb..a404ebd 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -24,26 +24,6 @@
 #include <linux/mfd/da9052/pdata.h>
 #include <linux/mfd/da9052/gpio.h>
 
-#define DA9052_INPUT				1
-#define DA9052_OUTPUT_OPENDRAIN		2
-#define DA9052_OUTPUT_PUSHPULL			3
-
-#define DA9052_SUPPLY_VDD_IO1			0
-
-#define DA9052_DEBOUNCING_OFF			0
-#define DA9052_DEBOUNCING_ON			1
-
-#define DA9052_OUTPUT_LOWLEVEL			0
-
-#define DA9052_ACTIVE_LOW			0
-#define DA9052_ACTIVE_HIGH			1
-
-#define DA9052_GPIO_MAX_PORTS_PER_REGISTER	8
-#define DA9052_GPIO_SHIFT_COUNT(no)		(no%8)
-#define DA9052_GPIO_MASK_UPPER_NIBBLE		0xF0
-#define DA9052_GPIO_MASK_LOWER_NIBBLE		0x0F
-#define DA9052_GPIO_NIBBLE_SHIFT		4
-
 struct da9052_gpio {
 	struct da9052 *da9052;
 	struct gpio_chip gp;
@@ -104,33 +84,26 @@ static int da9052_gpio_get(struct gpio_chip *gc, unsigned offset)
 static void da9052_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
 {
 	struct da9052_gpio *gpio = to_da9052_gpio(gc);
-	unsigned char register_value = 0;
 	int ret;
 
 	if (da9052_gpio_port_odd(offset)) {
-		if (value) {
-			register_value = DA9052_GPIO_ODD_PORT_MODE;
 			ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
 						DA9052_GPIO_0_1_REG,
 						DA9052_GPIO_ODD_PORT_MODE,
-						register_value);
+						value << DA9052_GPIO_ODD_SHIFT);
 			if (ret != 0)
 				dev_err(gpio->da9052->dev,
 					"Failed to updated gpio odd reg,%d",
 					ret);
-		}
 	} else {
-		if (value) {
-			register_value = DA9052_GPIO_EVEN_PORT_MODE;
 			ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
 						DA9052_GPIO_0_1_REG,
 						DA9052_GPIO_EVEN_PORT_MODE,
-						register_value);
+						value << DA9052_GPIO_EVEN_SHIFT);
 			if (ret != 0)
 				dev_err(gpio->da9052->dev,
 					"Failed to updated gpio even reg,%d",
 					ret);
-		}
 	}
 }
 
@@ -201,9 +174,9 @@ static struct gpio_chip reference_gp __devinitdata = {
 	.direction_input = da9052_gpio_direction_input,
 	.direction_output = da9052_gpio_direction_output,
 	.to_irq = da9052_gpio_to_irq,
-	.can_sleep = 1;
-	.ngpio = 16;
-	.base = -1;
+	.can_sleep = 1,
+	.ngpio = 16,
+	.base = -1,
 };
 
 static int __devinit da9052_gpio_probe(struct platform_device *pdev)
diff --git a/include/linux/mfd/da9052/gpio.h b/include/linux/mfd/da9052/gpio.h
new file mode 100644
index 0000000..c427670
--- /dev/null
+++ b/include/linux/mfd/da9052/gpio.h
@@ -0,0 +1,48 @@
+/*
+ * GPIO module declarations for DA9052 PMICs.
+ *
+ * Copyright(c) 2011 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef __LINUX_MFD_DA9052_GPIO_H
+#define __LINUX_MFD_DA9052_GPIO_H
+
+#define DA9052_INPUT				1
+#define DA9052_OUTPUT_OPENDRAIN		2
+#define DA9052_OUTPUT_PUSHPULL			3
+
+#define DA9052_SUPPLY_VDD_IO1			0
+
+#define DA9052_DEBOUNCING_OFF			0
+#define DA9052_DEBOUNCING_ON			1
+
+#define DA9052_OUTPUT_LOWLEVEL			0
+
+#define DA9052_ACTIVE_LOW			0
+#define DA9052_ACTIVE_HIGH			1
+
+#define DA9052_GPIO_MAX_PORTS_PER_REGISTER	8
+#define DA9052_GPIO_SHIFT_COUNT(no)		(no%8)
+#define DA9052_GPIO_MASK_UPPER_NIBBLE		0xF0
+#define DA9052_GPIO_MASK_LOWER_NIBBLE		0x0F
+#define DA9052_GPIO_NIBBLE_SHIFT		4
+#define DA9052_IRQ_GPI0			16
+#define DA9052_GPIO_ODD_SHIFT			7
+#define DA9052_GPIO_EVEN_SHIFT			3
+
+#endif /* __LINUX_MFD_DA9052_GPIO_H */
---
On Thu, 2011-12-15 at 14:31 +0530, Ashish Jangam wrote:
> 
> Hi Mark,
> 
> After merging the regmap tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/gpio/gpio-da9052.c:25:35: fatal error: linux/mfd/da9052/gpio.h: No such file or directory
> 
> So, it looks like this would never have built
> (include/linux/mfd/da9052/gpio.h never existed) but noone ever enabled
> CONFIG_PMIC_DA9052 before (which CONFIG_GPIO_DA9052 depends on).
> 
> drivers/gpio/gpio-da9052.c was added with commit 07bfc9152365 ("GPIO:
> DA9052 GPIO module v3") in v3.1-rc1.
> 
> I have added this patch for today:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 15 Dec 2011 16:59:59 +1100
> Subject: [PATCH] gpio: disable broken driver
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/gpio/Kconfig |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 79199f4..e338013 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -70,7 +70,7 @@ config GPIO_GENERIC
>  
>  config GPIO_DA9052
>  	tristate "Dialog DA9052 GPIO"
> -	depends on PMIC_DA9052
> +	depends on PMIC_DA9052 && BROKEN
>  	help
>  	  Say yes here to enable the GPIO driver for the DA9052 chip.
>  
> -- 
> 1.7.7.3
> 

WARNING: multiple messages have this Message-ID (diff)
From: Ashish Jangam <ashish.jangam@kpitcummins.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: <linux-next@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Dajun <dajun.chen@diasemi.com>
Subject: Re: linux-next: build failure after merge of the regmap tree
Date: Thu, 15 Dec 2011 14:55:46 +0530	[thread overview]
Message-ID: <1323941146.32031.49.camel@dhruva> (raw)
In-Reply-To: <C3AE124F08223B42BC95AEB82F0F6CED1F9D0895@KCHJEXMB01.kpit.com>

Fixes DA9052 GPIO errors.

This patch is functionally tested on Samsung SMDKV6410.

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
---
 drivers/gpio/gpio-da9052.c      |   37 ++++--------------------------
 include/linux/mfd/da9052/gpio.h |   48 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 32 deletions(-)
 create mode 100644 include/linux/mfd/da9052/gpio.h
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index 038f5eb..a404ebd 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -24,26 +24,6 @@
 #include <linux/mfd/da9052/pdata.h>
 #include <linux/mfd/da9052/gpio.h>
 
-#define DA9052_INPUT				1
-#define DA9052_OUTPUT_OPENDRAIN		2
-#define DA9052_OUTPUT_PUSHPULL			3
-
-#define DA9052_SUPPLY_VDD_IO1			0
-
-#define DA9052_DEBOUNCING_OFF			0
-#define DA9052_DEBOUNCING_ON			1
-
-#define DA9052_OUTPUT_LOWLEVEL			0
-
-#define DA9052_ACTIVE_LOW			0
-#define DA9052_ACTIVE_HIGH			1
-
-#define DA9052_GPIO_MAX_PORTS_PER_REGISTER	8
-#define DA9052_GPIO_SHIFT_COUNT(no)		(no%8)
-#define DA9052_GPIO_MASK_UPPER_NIBBLE		0xF0
-#define DA9052_GPIO_MASK_LOWER_NIBBLE		0x0F
-#define DA9052_GPIO_NIBBLE_SHIFT		4
-
 struct da9052_gpio {
 	struct da9052 *da9052;
 	struct gpio_chip gp;
@@ -104,33 +84,26 @@ static int da9052_gpio_get(struct gpio_chip *gc, unsigned offset)
 static void da9052_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
 {
 	struct da9052_gpio *gpio = to_da9052_gpio(gc);
-	unsigned char register_value = 0;
 	int ret;
 
 	if (da9052_gpio_port_odd(offset)) {
-		if (value) {
-			register_value = DA9052_GPIO_ODD_PORT_MODE;
 			ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
 						DA9052_GPIO_0_1_REG,
 						DA9052_GPIO_ODD_PORT_MODE,
-						register_value);
+						value << DA9052_GPIO_ODD_SHIFT);
 			if (ret != 0)
 				dev_err(gpio->da9052->dev,
 					"Failed to updated gpio odd reg,%d",
 					ret);
-		}
 	} else {
-		if (value) {
-			register_value = DA9052_GPIO_EVEN_PORT_MODE;
 			ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
 						DA9052_GPIO_0_1_REG,
 						DA9052_GPIO_EVEN_PORT_MODE,
-						register_value);
+						value << DA9052_GPIO_EVEN_SHIFT);
 			if (ret != 0)
 				dev_err(gpio->da9052->dev,
 					"Failed to updated gpio even reg,%d",
 					ret);
-		}
 	}
 }
 
@@ -201,9 +174,9 @@ static struct gpio_chip reference_gp __devinitdata = {
 	.direction_input = da9052_gpio_direction_input,
 	.direction_output = da9052_gpio_direction_output,
 	.to_irq = da9052_gpio_to_irq,
-	.can_sleep = 1;
-	.ngpio = 16;
-	.base = -1;
+	.can_sleep = 1,
+	.ngpio = 16,
+	.base = -1,
 };
 
 static int __devinit da9052_gpio_probe(struct platform_device *pdev)
diff --git a/include/linux/mfd/da9052/gpio.h b/include/linux/mfd/da9052/gpio.h
new file mode 100644
index 0000000..c427670
--- /dev/null
+++ b/include/linux/mfd/da9052/gpio.h
@@ -0,0 +1,48 @@
+/*
+ * GPIO module declarations for DA9052 PMICs.
+ *
+ * Copyright(c) 2011 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef __LINUX_MFD_DA9052_GPIO_H
+#define __LINUX_MFD_DA9052_GPIO_H
+
+#define DA9052_INPUT				1
+#define DA9052_OUTPUT_OPENDRAIN		2
+#define DA9052_OUTPUT_PUSHPULL			3
+
+#define DA9052_SUPPLY_VDD_IO1			0
+
+#define DA9052_DEBOUNCING_OFF			0
+#define DA9052_DEBOUNCING_ON			1
+
+#define DA9052_OUTPUT_LOWLEVEL			0
+
+#define DA9052_ACTIVE_LOW			0
+#define DA9052_ACTIVE_HIGH			1
+
+#define DA9052_GPIO_MAX_PORTS_PER_REGISTER	8
+#define DA9052_GPIO_SHIFT_COUNT(no)		(no%8)
+#define DA9052_GPIO_MASK_UPPER_NIBBLE		0xF0
+#define DA9052_GPIO_MASK_LOWER_NIBBLE		0x0F
+#define DA9052_GPIO_NIBBLE_SHIFT		4
+#define DA9052_IRQ_GPI0			16
+#define DA9052_GPIO_ODD_SHIFT			7
+#define DA9052_GPIO_EVEN_SHIFT			3
+
+#endif /* __LINUX_MFD_DA9052_GPIO_H */
---
On Thu, 2011-12-15 at 14:31 +0530, Ashish Jangam wrote:
> 
> Hi Mark,
> 
> After merging the regmap tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/gpio/gpio-da9052.c:25:35: fatal error: linux/mfd/da9052/gpio.h: No such file or directory
> 
> So, it looks like this would never have built
> (include/linux/mfd/da9052/gpio.h never existed) but noone ever enabled
> CONFIG_PMIC_DA9052 before (which CONFIG_GPIO_DA9052 depends on).
> 
> drivers/gpio/gpio-da9052.c was added with commit 07bfc9152365 ("GPIO:
> DA9052 GPIO module v3") in v3.1-rc1.
> 
> I have added this patch for today:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 15 Dec 2011 16:59:59 +1100
> Subject: [PATCH] gpio: disable broken driver
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/gpio/Kconfig |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 79199f4..e338013 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -70,7 +70,7 @@ config GPIO_GENERIC
>  
>  config GPIO_DA9052
>  	tristate "Dialog DA9052 GPIO"
> -	depends on PMIC_DA9052
> +	depends on PMIC_DA9052 && BROKEN
>  	help
>  	  Say yes here to enable the GPIO driver for the DA9052 chip.
>  
> -- 
> 1.7.7.3
> 



       reply	other threads:[~2011-12-15  9:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <C3AE124F08223B42BC95AEB82F0F6CED1F9D0895@KCHJEXMB01.kpit.com>
2011-12-15  9:25 ` Ashish Jangam [this message]
2011-12-15  9:25   ` linux-next: build failure after merge of the regmap tree Ashish Jangam
2011-12-15 18:25   ` Grant Likely
2011-12-16  7:19     ` Ashish Jangam
2011-12-16  8:11       ` Grant Likely
2011-12-16  8:15         ` Ashish Jangam
2011-12-16  8:25           ` Grant Likely
2020-11-27  7:24 Stephen Rothwell
2020-11-30 17:59 ` Mark Brown
2020-11-30 18:07   ` Pierre-Louis Bossart
2020-11-30 18:11     ` Mark Brown
2020-11-30 18:21       ` Pierre-Louis Bossart
  -- strict thread matches above, loose matches on Subject: below --
2017-11-02  0:57 Stephen Rothwell
2012-04-11  4:13 Stephen Rothwell
2012-04-11  8:17 ` Mark Brown
2012-02-27  4:05 Stephen Rothwell
2011-12-15  6:17 Stephen Rothwell
2011-12-15  6:05 Stephen Rothwell
2011-12-15  6:17 ` Mark Brown
2011-12-15  6:24   ` Ashish Jangam
2011-12-15  6:24     ` Ashish Jangam
2011-09-29  5:18 Stephen Rothwell
2011-09-29  9:43 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323941146.32031.49.camel@dhruva \
    --to=ashish.jangam@kpitcummins.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dajun.chen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.