Re: [PATCH 2/2] msm: 8x50: Add initial support for SDCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sahitya,

On 1/18/2011 11:22 AM, Sahitya Tummala wrote:
Signed-off-by: Sahitya Tummala<stummala@xxxxxxxxxxxxxx>
---
  arch/arm/mach-msm/board-qsd8x50.c               |   81 +++++++++-
  arch/arm/mach-msm/devices-qsd8x50.c             |  196 +++++++++++++++++++++++
  arch/arm/mach-msm/gpiomux-8x50.c                |   23 +++
  arch/arm/mach-msm/include/mach/msm_iomap-8x50.h |    8 +-
  4 files changed, 303 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 6dde818..29ef683 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.

Why not 2008-2011?

   *
   * 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
@@ -21,6 +21,7 @@
  #include<linux/platform_device.h>
  #include<linux/delay.h>
  #include<linux/usb/msm_hsusb.h>
+#include<linux/err.h>

  #include<asm/mach-types.h>
  #include<asm/mach/arch.h>
@@ -31,6 +32,8 @@
  #include<mach/irqs.h>
  #include<mach/sirc.h>
  #include<mach/gpio.h>
+#include<mach/vreg.h>
+#include<mach/mmc.h>

  #include "devices.h"

@@ -95,6 +98,81 @@ static struct platform_device *devices[] __initdata = {
  	&msm_device_hsusb_host,
  };

+static struct msm_mmc_gpio sdc1_gpio_cfg[] = {
+	{51, "sdc1_dat_3"},
+	{52, "sdc1_dat_2"},
+	{53, "sdc1_dat_1"},
+	{54, "sdc1_dat_0"},
+	{55, "sdc1_cmd"},
+	{56, "sdc1_clk"}
+};
+
+static struct vreg *vreg_mmc;
+static unsigned long vreg_sts;
+
+static uint32_t msm_sdcc_setup_power(struct device *dv, unsigned int vdd)
+{
+	int rc = 0;
+	struct platform_device *pdev;
+
+	pdev = container_of(dv, struct platform_device, dev);
+
+	if (vdd == 0) {
+		if (!vreg_sts)
+			return 0;
+
+		clear_bit(pdev->id,&vreg_sts);
+
+		if (!vreg_sts) {
+			rc = vreg_disable(vreg_mmc);
+			if (rc)
+				pr_err("vreg_mmc disable failed for slot "
+						"%d: %d\n", pdev->id, rc);
+		}
+		return 0;
+	}
+
+	if (!vreg_sts) {
+		rc = vreg_set_level(vreg_mmc, 2900);
+		if (rc)
+			pr_err("vreg_mmc set level failed for slot %d: %d\n",
+					pdev->id, rc);
+		rc = vreg_enable(vreg_mmc);
+		if (rc)
+			pr_err("vreg_mmc enable failed for slot %d: %d\n",
+					pdev->id, rc);
+	}
+	set_bit(pdev->id,&vreg_sts);

non-atomic version? __set_bit?

---Trilok Soni

--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux