Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3be4422 authored by Vamsi Krishna's avatar Vamsi Krishna
Browse files

xhci-msm-hsic: Add support to handle channel ready gpio



Channel ready gpio is used to indicate channel readiness to
attached peripheral. This gpio was handled in platform specific
driver due to h/w limitations on older platforms. Add support to
handle this gpio from hsic driver and remove the support from
platform specific driver. Userspace peripheral handler will use
sysfs entry to assert channel readiness to peripheral
Sysfs entry and Usage:
echo 1 > /sys/devices/msm_hsic_host/host_ready

Change-Id: I8b41582360507e837f830f758838f62f7a55aa45
Signed-off-by: default avatarVamsi Krishna <vskrishn@codeaurora.org>
parent a525e5d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ Required properties :
Optional properties :
- interrupt-names : Optional interrupt resource entry is:
  "wakeup_irq" : Interrupt generated by out of band remote wakeup gpio.
- qcom,host-ready-gpio: This gpio will be used to indicate hsic host
  readiness to attached peripheral
- Refer to "Documentation/devicetree/bindings/arm/msm/msm_bus.txt" for
  below optional properties:
    - qcom,msm_bus,name
+0 −1
Original line number Diff line number Diff line
@@ -152,7 +152,6 @@
	qcom,ap2mdm-wakeup-gpio = <&msmgpio 108 0x00>;
	qcom,ap2mdm-vddmin-gpio = <&msmgpio 114 0x00>;
	qcom,mdm2ap-vddmin-gpio = <&msmgpio 115 0x00>;
	qcom,ap2mdm-chnlrdy-gpio = <&msmgpio 106 0x00>;
	status = "ok";
};

+0 −1
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@
	qcom,ap2mdm-wakeup-gpio = <&msmgpio 108 0x00>;
	qcom,ap2mdm-vddmin-gpio = <&msmgpio 114 0x00>;
	qcom,mdm2ap-vddmin-gpio = <&msmgpio 115 0x00>;
	qcom,ap2mdm-chnlrdy-gpio = <&msmgpio 106 0x00>;
	status = "ok";
};

+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, The Linux Foundation. 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
@@ -2126,6 +2126,7 @@
		hsic-gdsc-supply = <&gdsc_usb_hsic>;
		hsic,strobe-gpio = <&msmgpio 134 0x00>;
		hsic,data-gpio = <&msmgpio 135 0x00>;
		qcom,host-ready-gpio = <&msmgpio 106 0x00>;
		qcom,vdd-voltage-level = <1 4 7>; /* none svs turbo */
		qcom,disable-hw-clk-gating;

+22 −14
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, The Linux Foundation. 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
@@ -52,12 +52,6 @@ static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
	.pull = GPIOMUX_PULL_NONE,
};

static struct gpiomux_setting ap2mdm_chnlrdy = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_8MA,
	.pull = GPIOMUX_PULL_DOWN,
};

static struct gpiomux_setting ap2mdm_wakeup = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_8MA,
@@ -129,13 +123,6 @@ static struct msm_gpiomux_config mdm_configs[] __initdata = {
			[GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
		}
	},
	/* AP2MDM_CHNLRDY */
	{
		.gpio = 106,
		.settings = {
			[GPIOMUX_SUSPENDED] = &ap2mdm_chnlrdy,
		}
	},
	/* AP2MDM_WAKEUP */
	{
		.gpio = 108,
@@ -664,6 +651,20 @@ static struct gpiomux_setting hsic_wakeup_sus_cfg = {
	.dir = GPIOMUX_IN,
};

static struct gpiomux_setting hsic_ap2mdm_chlrdy_act_cfg = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_8MA,
	.pull = GPIOMUX_PULL_NONE,
	.dir = GPIOMUX_OUT_LOW,
};

static struct gpiomux_setting hsic_ap2mdm_chlrdy_sus_cfg = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_DOWN,
	.dir = GPIOMUX_OUT_LOW,
};

static struct msm_gpiomux_config apq8084_hsic_configs[] = {
	{
		.gpio = 134,               /*HSIC_STROBE */
@@ -686,6 +687,13 @@ static struct msm_gpiomux_config apq8084_hsic_configs[] = {
			[GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
		},
	},
	{
		.gpio = 106,
		.settings = {
			[GPIOMUX_ACTIVE] = &hsic_ap2mdm_chlrdy_act_cfg,
			[GPIOMUX_SUSPENDED] = &hsic_ap2mdm_chlrdy_sus_cfg,
		}
	},
};

static struct gpiomux_setting lcd_en_act_cfg = {
Loading