How to add 3G modem in Sabresx board
From 7fb55cad18e2d482aa88fe6ed0ee552df6a813c2 Mon Sep 17 00:00:00 2001
From: Jianzheng Zhou <Jianzheng.zhou@freescale.com>Date: Mon, 30 Jun 2014 17:31:03 +0800
Subject: [PATCH] Add 3G modem support
Signed-off-by: Jianzheng Zhou <Jianzheng.zhou@freescale.com>
---
arch/arm/boot/dts/imx6sx-sdb.dts | 5 +++++
arch/arm/mach-imx/mach-imx6sx.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
index 9c58768..aa1bd4d 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb.dts
@@ -146,6 +146,10 @@
status = "okay";
};
+ minipcie_ctrl {
+ power-on-gpio = <&gpio2 1 0>;
+ };
+
bt_rfkill {
compatible = "fsl,mxc_bt_rfkill";
bt-power-gpios = <&gpio4 10 0>;
@@ -425,6 +429,7 @@
hog {
pinctrl_hog: hoggrp {
fsl,pins = <
+ MX6SX_PAD_ENET1_CRS__GPIO2_IO_1 0x80000000
MX6SX_PAD_ENET2_COL__GPIO2_IO_6 0x80000000
MX6SX_PAD_QSPI1A_DATA0__GPIO4_IO_16 0x80000000
MX6SX_PAD_QSPI1A_DATA3__GPIO4_IO_19 0x80000000
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index c5a8ef3..6bfca53 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -223,6 +223,29 @@ static void __init imx6sx_enet_plt_init(void)
if (np && of_get_property(np, "fsl,magic-packet", NULL))
fec_pdata[1].sleep_mode_enable = imx6sx_fec2_stop_enable;
}
+/*
+ * Init GPIO PCIE_PWR_EN to keep power supply to miniPCIE 3G modem
+ *
+ */
+static void __init imx6sx_mini_pcie_init(void)
+{
+ struct device_node *np = NULL;
+ int ret, power_on_gpio;
+ np = of_find_node_by_name(NULL, "minipcie_ctrl");
+ if (!np)
+ return;
+
+ power_on_gpio = of_get_named_gpio(np, "power-on-gpio", 0);
+ if (gpio_is_valid(power_on_gpio)) {
+ ret = gpio_request_one(power_on_gpio,
+ GPIOF_OUT_INIT_HIGH,
+ "miniPCIE Power On");
+ pr_warn("!!request miniPCIE Power On gpio\n");
+ if (ret)
+ pr_warn("failed to request miniPCIE Power On gpio\n");
+ }
+}
+
static inline void imx6sx_enet_init(void)
{
@@ -276,6 +299,7 @@ static void __init imx6sx_init_machine(void)
imx_anatop_init();
imx6_pm_init();
imx6sx_qos_init();
+ imx6sx_mini_pcie_init();
}
static void __init imx6sx_opp_init(struct device *cpu_dev)
--
1.8.0