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

Commit 58221709 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

USB: HSIC SMSC HUB: Add support for standalone HSIC configuration



When model-id is passed as 0, interpret it as standalone HSIC
configuration. Add HSIC platform device and don't look for HUB
resources. This is required to support both stand alone and HUB
configurations on different boards based on the same SoC.

Change-Id: Iec081799048dd93ece1472d95a7e1c27f91fb9b9
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent c68403f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -134,7 +134,8 @@ SMSC HSIC HUB

Required properties :
- compatible : should be "qcom,hsic-smsc-hub"
- smsc,model-id : should be either <3503> or <4604> depending on hub model
- smsc,model-id : should be either <3503> or <4604> depending on hub model. It
  will be 0 for standalone HSIC controller configuration.
- smsc,reset-gpio: this output gpio is used to assert/de-assert the hub reset
- Sub node for "MSM HSIC EHCI controller".
  Sub node has the required properties mentioned above.
+17 −0
Original line number Diff line number Diff line
@@ -368,6 +368,8 @@ struct smsc_hub_platform_data *msm_hub_dt_to_pdata(
		return ERR_PTR(rc);
	} else {
		pdata->model_id = temp_val;
		if (pdata->model_id == 0)
			return pdata;
	}

	pdata->hub_reset = of_get_named_gpio(node, "smsc,reset-gpio", 0);
@@ -409,6 +411,12 @@ static int smsc_hub_probe(struct platform_device *pdev)
		return -ENODEV;
	}

	if (pdata->model_id == 0) {
		dev_dbg(&pdev->dev, "standalone HSIC config enabled\n");
		return of_platform_populate(node, NULL,
				hsic_host_auxdata, &pdev->dev);
	}

	if (!pdata->hub_reset)
		return -EINVAL;

@@ -530,6 +538,9 @@ static int smsc_hub_remove(struct platform_device *pdev)
{
	const struct smsc_hub_platform_data *pdata;

	if (!smsc_hub)
		return 0;

	pdata = smsc_hub->pdata;
	if (smsc_hub->client) {
		i2c_unregister_device(smsc_hub->client);
@@ -559,6 +570,9 @@ static int smsc_hub_lpm_enter(struct device *dev)
{
	int ret = 0;

	if (!smsc_hub)
		return 0;

	if (smsc_hub->xo_handle) {
		ret = msm_xo_mode_vote(smsc_hub->xo_handle, MSM_XO_MODE_OFF);
		if (ret) {
@@ -573,6 +587,9 @@ static int smsc_hub_lpm_exit(struct device *dev)
{
	int ret = 0;

	if (!smsc_hub)
		return 0;

	if (smsc_hub->xo_handle) {
		ret = msm_xo_mode_vote(smsc_hub->xo_handle, MSM_XO_MODE_ON);
		if (ret) {