Skip to contentSkip to conversation

ARM: MSM: Consolidate GPIOMUX for 7x30 and 8x50

PATCH In review Rohit Vaswani 2 participants 9 messages Jun 19, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover ARM: MSM: Consolidate GPIOMUX for 7x30 and 8x50

The previous gpio clean up series left some room for consolidation and required a few fixes.

Rohit Vaswani (4):
ARM: msm: dts: Fix the gpio register address for msm8960
drivers: gpio: msm: Fix the error condition for reading ngpio
ARM: msm: Consolidate gpiomux for older architectures
drivers: gpio: msm: Remove __devinit

 arch/arm/boot/dts/msm8960-cdp.dts |    4 ++--
 arch/arm/mach-msm/Kconfig         |    3 +--
 arch/arm/mach-msm/gpiomux-v1.c    |   33 ---------------------------------
 arch/arm/mach-msm/gpiomux.h       |   10 ----------
 drivers/gpio/gpio-msm-v1.c        |    2 +-
 drivers/gpio/gpio-msm-v2.c        |    2 +-
 6 files changed, 5 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-msm/gpiomux-v1.c
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#1 lore raw

PATCH 1/4 ARM: msm: dts: Fix the gpio register address for msm8960

Fix the the gpio reg address for the device tree entry.

---
 arch/arm/boot/dts/msm8960-cdp.dts |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/msm8960-cdp.dts +2 -2
index 52fe253..1599764 100644
@@ -26,7 +26,7 @@
 		cpu-offset = <0x80000>;
 	};
 
-	msmgpio: gpio@fd510000 {
+	msmgpio: gpio@800000 {
 		compatible = "qcom,msm-gpio";
 		gpio-controller;
 		#gpio-cells = <2>;
@@ -34,7 +34,7 @@
 		interrupts = <0 32 0x4>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
-		reg = <0xfd510000 0x4000>;
+		reg = <0x800000 0x4000>;
 	};
 
 	serial@19c400000 {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#2 lore raw

PATCH 2/4 drivers: gpio: msm: Fix the error condition for reading ngpio

In reply to Rohit Vaswani

of_property_read_u32 return 0 on success. The check was using a ! to return error. Fix the if condition.

---
 drivers/gpio/gpio-msm-v2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/gpio-msm-v2.c +1 -1
index f4491a4..c2fa770 100644
@@ -378,7 +378,7 @@ static int msm_gpio_probe(struct platform_device *pdev)
 	int ret, ngpio;
 	struct resource *res;
 
-	if (!of_property_read_u32(pdev->dev.of_node, "ngpio", &ngpio)) {
+	if (of_property_read_u32(pdev->dev.of_node, "ngpio", &ngpio)) {
 		dev_err(&pdev->dev, "%s: ngpio property missing\n", __func__);
 		return -EINVAL;
 	}
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#4 lore raw

Re: [PATCH 2/4] drivers: gpio: msm: Fix the error condition for reading ngpio

Quoted 5 lines · Linus Walleij
Quoted 3 lines · Rohit Vaswani

of_property_read_u32 return 0 on success. The check was using a ! to return error. Fix the if condition.

Quoted 7 lines
Quoted 1 line

I guess this is going through the MSM tree as well?

Yours,
Linus Walleij

Yes, going through MSM tree.

Thanks,
Rohit Vaswani

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
#5 lore raw

PATCH 3/4 ARM: msm: Consolidate gpiomux for older architectures

In reply to Rohit Vaswani

Msm gpiomux can be used only for 7x30 and 8x50. Prevent compilation and fix build issues on 7X00, 8X60 and 8960.

---
 arch/arm/mach-msm/Kconfig      |    3 +--
 arch/arm/mach-msm/gpiomux-v1.c |   33 ---------------------------------
 arch/arm/mach-msm/gpiomux.h    |   10 ----------
 3 files changed, 1 insertions(+), 45 deletions(-)
 delete mode 100644 arch/arm/mach-msm/gpiomux-v1.c
arch/arm/mach-msm/Kconfig +1 -2
index 614e41e..905efc8 100644
@@ -121,8 +121,7 @@ config MSM_SMD
 	bool
 
 config MSM_GPIOMUX
-	depends on !(ARCH_MSM8X60 || ARCH_MSM8960)
-	bool "MSM V1 TLMM GPIOMUX architecture"
+	bool
 	help
 	  Support for MSM V1 TLMM GPIOMUX architecture.
 
arch/arm/mach-msm/gpiomux-v1.c deleted +0 -33
deleted file mode 100644
index 27de2ab..0000000
@@ -1,33 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#include <linux/kernel.h>
-#include "gpiomux.h"
-#include "proc_comm.h"
-
-void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val)
-{
-	unsigned tlmm_config  = (val & ~GPIOMUX_CTL_MASK) |
-				((gpio & 0x3ff) << 4);
-	unsigned tlmm_disable = 0;
-	int rc;
-
-	rc = msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX,
-			   &tlmm_config, &tlmm_disable);
-	if (rc)
-		pr_err("%s: unexpected proc_comm failure %d: %08x %08x\n",
-		       __func__, rc, tlmm_config, tlmm_disable);
-}
arch/arm/mach-msm/gpiomux.h +0 -10
index 8e82f41..4410d77 100644
@@ -73,16 +73,6 @@ extern struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS];
 int msm_gpiomux_write(unsigned gpio,
 		      gpiomux_config_t active,
 		      gpiomux_config_t suspended);
-
-/* Architecture-internal function for use by the framework only.
- * This function can assume the following:
- * - the gpio value has passed a bounds-check
- * - the gpiomux spinlock has been obtained
- *
- * This function is not for public consumption.  External users
- * should use msm_gpiomux_write.
- */
-void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val);
 #else
 static inline int msm_gpiomux_write(unsigned gpio,
 				    gpiomux_config_t active,
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#6 lore raw

PATCH 4/4 drivers: gpio: msm: Remove __devinit

In reply to Rohit Vaswani

Remove stray usage of __devinit as it has been removed.

---
 drivers/gpio/gpio-msm-v1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/gpio-msm-v1.c +1 -1
index c798585..fb2cc90 100644
@@ -630,7 +630,7 @@ static struct irq_chip msm_gpio_irq_chip = {
 	.irq_set_type  = msm_gpio_irq_set_type,
 };
 
-static int __devinit gpio_msm_v1_probe(struct platform_device *pdev)
+static int gpio_msm_v1_probe(struct platform_device *pdev)
 {
 	int i, j = 0;
 	const struct platform_device_id *dev_id = platform_get_device_id(pdev);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#7 lore raw

Re: [PATCH 4/4] drivers: gpio: msm: Remove __devinit

Quoted 3 lines · Rohit Vaswani

Remove stray usage of __devinit as it has been removed.

A patch for this is already merged.

Thanks,
Linus Walleij

#8 lore raw
In reply to Rohit Vaswani

**Please ignore this 4 patch series**
Sorry for the inconvenience.

Quoted 9 lines · Rohit Vaswani

The previous gpio clean up series left some room for consolidation and required a few fixes.

Rohit Vaswani (4):
ARM: msm: dts: Fix the gpio register address for msm8960
drivers: gpio: msm: Fix the error condition for reading ngpio
ARM: msm: Consolidate gpiomux for older architectures
drivers: gpio: msm: Remove __devinit

Quoted 9 lines
  arch/arm/boot/dts/msm8960-cdp.dts |    4 ++--
  arch/arm/mach-msm/Kconfig         |    3 +--
  arch/arm/mach-msm/gpiomux-v1.c    |   33 ---------------------------------
  arch/arm/mach-msm/gpiomux.h       |   10 ----------
  drivers/gpio/gpio-msm-v1.c        |    2 +-
  drivers/gpio/gpio-msm-v2.c        |    2 +-
  6 files changed, 5 insertions(+), 49 deletions(-)

delete mode 100644 arch/arm/mach-msm/gpiomux-v1.c

Thanks,
Rohit Vaswani

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation