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

Commit 001d0b6e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: ci13xxx: Remove support to enable function based streaming"

parents ca27643e a1adea57
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -19,12 +19,6 @@ Optional properties :
  happening and it is OK to have higher DMA latency to save power.
  Third value represents DMA latency to vote when USB BUS is IDLE and absolutely
  no transfers are happening. It should allow transition to lowest power state.
- qcom,streaming-func : add list of usb function name. If mention usb function
  is being enable as part of USB composition, streaming mode is enable with
  usb device controller to get better throughput. NOTE: Inverted CRC and
  turnaround timeout is observed on enabling streaming. Hence it is required
  to see these errors and number of erros on enabling this at USB level to make
  final decision to enable this feature or not.
- qcom,usb-core-id: Index to refer USB hardware core to bind android gadget driver
  with UDC if multiple USB peripheral controllers are present. If unspecified,
  core is set to zero by default.
@@ -37,7 +31,6 @@ Example Android USB device node :
		compatible = "qcom,android-usb";
		reg = <0xfc42b0c8 0xc8>;
		qcom,pm-qos-latency = <2 1001 12701>;
		qcom,streaming-func = "rndis","mtp";
		qcom,supported-func = "rndis_gsi","ecm_gsi","rmnet_gsi";
		qcom,usb-core-id = <1>;
	};
+0 −50
Original line number Diff line number Diff line
@@ -3245,20 +3245,6 @@ android_unbind_enabled_functions(struct android_dev *dev,
		f_holder->f->bound = false;
	}
}
static inline void check_streaming_func(struct usb_gadget *gadget,
		struct android_usb_platform_data *pdata,
		char *name)
{
	int i;

	for (i = 0; i < pdata->streaming_func_count; i++) {
		if (!strcmp(name, pdata->streaming_func[i])) {
			pr_debug("set streaming_enabled to true\n");
			gadget->streaming_enabled = true;
			break;
		}
	}
}
static int android_enable_function(struct android_dev *dev,
				   struct android_configuration *conf,
				   char *name)
@@ -3266,8 +3252,6 @@ static int android_enable_function(struct android_dev *dev,
	struct android_usb_function **functions = dev->functions;
	struct android_usb_function *f;
	struct android_usb_function_holder *f_holder;
	struct android_usb_platform_data *pdata = dev->pdata;
	struct usb_gadget *gadget = dev->cdev->gadget;

	while ((f = *functions++)) {
		if (!strcmp(name, f->name)) {
@@ -3287,11 +3271,6 @@ static int android_enable_function(struct android_dev *dev,
				list_add_tail(&f_holder->enabled_list,
					      &conf->enabled_functions);
				pr_debug("func:%s is enabled.\n", f->name);
				/*
				 * compare enable function with streaming func
				 * list and based on the same request streaming.
				 */
				check_streaming_func(gadget, pdata, f->name);

				return 0;
			}
@@ -3413,7 +3392,6 @@ functions_store(struct device *pdev, struct device_attribute *attr,
	strlcpy(buf, buff, sizeof(buf));
	b = strim(buf);

	dev->cdev->gadget->streaming_enabled = false;
	while (b) {
		conf_str = strsep(&b, ":");
		if (!conf_str)
@@ -4098,34 +4076,6 @@ static int android_probe(struct platform_device *pdev)
		if (!ret)
			pdata->usb_core_id = usb_core_id;

		len = of_property_count_strings(pdev->dev.of_node,
				"qcom,streaming-func");
		if (len > MAX_STREAMING_FUNCS) {
			pr_err("Invalid number of functions used.\n");
			return -EINVAL;
		}

		for (i = 0; i < len; i++) {
			const char *name = NULL;

			of_property_read_string_index(pdev->dev.of_node,
				"qcom,streaming-func", i, &name);

			if (!name)
				continue;

			if (sizeof(name) > FUNC_NAME_LEN) {
				pr_err("Function name is bigger than allowed.\n");
				continue;
			}

			strlcpy(pdata->streaming_func[i], name,
				sizeof(pdata->streaming_func[i]));
			pr_debug("name of streaming function:%s\n",
				pdata->streaming_func[i]);
		}

		pdata->streaming_func_count = len;
	} else {
		pdata = pdev->dev.platform_data;
	}
+1 −42
Original line number Diff line number Diff line
@@ -373,41 +373,19 @@ static int hw_device_reset(struct ci13xxx *udc)
static int hw_device_state(u32 dma)
{
	struct ci13xxx *udc = _udc;
	struct usb_gadget *gadget = &udc->gadget;
	int ret;

	if (dma) {
		if (gadget->streaming_enabled || !(udc->udc_driver->flags &
				CI13XXX_DISABLE_STREAMING)) {
		if (!(udc->udc_driver->flags & CI13XXX_DISABLE_STREAMING)) {
			hw_cwrite(CAP_USBMODE, USBMODE_SDIS, 0);
			pr_debug("%s(): streaming mode is enabled. USBMODE:%x\n",
				 __func__, hw_cread(CAP_USBMODE, ~0));

			/* If streaming mode is enabled by default, system clock
			 * runs at max nominal clock rate. If not, it runs at
			 * lower freq (< max nominal clock rate). Streaming
			 * enabled will be set by composite layer to enable
			 * streaming depending on functions. In this case, bump
			 * up system clock to max nominal system clock rate from
			 * default value for better performance.
			 */
			if (udc->system_clk && (udc->udc_driver->flags &
				CI13XXX_DISABLE_STREAMING)) {
				ret = clk_set_rate(udc->system_clk,
					udc->max_nominal_system_clk_rate);
				if (ret)
					pr_err("fail to set system_clk: %d\n",
						ret);
			}
		} else {
			hw_cwrite(CAP_USBMODE, USBMODE_SDIS, USBMODE_SDIS);
			pr_debug("%s(): streaming mode is disabled. USBMODE:%x\n",
				__func__, hw_cread(CAP_USBMODE, ~0));
		}

		/* make sure clock set rate is finished before proceeding */
		mb();

		hw_cwrite(CAP_ENDPTLISTADDR, ~0, dma);


@@ -430,20 +408,6 @@ static int hw_device_state(u32 dma)
			hw_awrite(ABS_AHBMODE, AHB2AHB_BYPASS, 0);
			pr_debug("%s(): ByPass Mode is disabled. AHBMODE:%x\n",
					__func__, hw_aread(ABS_AHBMODE, ~0));

		/* In non-stream mode, due to HW limitation cannot go
		 * beyond 80MHz, otherwise, may see EP prime failures.
		 */
		if (udc->system_clk && (udc->udc_driver->flags &
				CI13XXX_DISABLE_STREAMING)) {
			ret = clk_set_rate(udc->system_clk,
						udc->default_system_clk_rate);
			if (ret)
				pr_err("fail to set system_clk ret:%d\n", ret);
		}

		/* make sure clock set rate is finished before proceeding */
		mb();
		}
	}
	return 0;
@@ -3892,13 +3856,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
	pdata = dev->platform_data;
	if (pdata) {
		udc->gadget.usb_core_id = pdata->usb_core_id;
		udc->system_clk = pdata->system_clk;
		udc->max_nominal_system_clk_rate =
					pdata->max_nominal_system_clk_rate;
		udc->default_system_clk_rate = pdata->default_system_clk_rate;
		if (pdata->enable_axi_prefetch)
			udc->gadget.extra_buf_alloc = EXTRA_ALLOCATION_SIZE;

	}

	if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
+0 −8
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@ struct ci13xxx_udc_driver {

	void	(*notify_event)(struct ci13xxx *udc, unsigned event);
	bool    (*in_lpm)(struct ci13xxx *udc);
	struct clk *system_clk;
};

/* CI13XXX UDC descriptor & global resources */
@@ -179,16 +178,9 @@ struct ci13xxx {
	int                        softconnect; /* is pull-up enable allowed */
	unsigned long dTD_update_fail_count;
	struct usb_phy            *transceiver; /* Transceiver struct */
	struct clk                *system_clk;
	bool                      skip_flush; /* skip flushing remaining EP
						upon flush timeout for the
						first EP. */
	u32			  max_nominal_system_clk_rate;	/* max freq to
						be voted for system clock in
						streaming mode */;
	u32			  default_system_clk_rate;	/* max freq at
						which system clock should run
						in non streaming mode */;
};

/******************************************************************************
+0 −6
Original line number Diff line number Diff line
@@ -3775,12 +3775,8 @@ static struct platform_device *msm_otg_add_pdev(
		ci_pdata.l1_supported = otg_pdata->l1_supported;
		ci_pdata.enable_ahb2ahb_bypass =
				otg_pdata->enable_ahb2ahb_bypass;
		ci_pdata.system_clk = otg_pdata->system_clk;
		ci_pdata.enable_streaming = otg_pdata->enable_streaming;
		ci_pdata.enable_axi_prefetch = otg_pdata->enable_axi_prefetch;
		ci_pdata.max_nominal_system_clk_rate =
					motg->max_nominal_system_clk_rate;
		ci_pdata.default_system_clk_rate = motg->core_clk_rate;
		retval = platform_device_add_data(pdev, &ci_pdata,
			sizeof(ci_pdata));
		if (retval)
@@ -4423,8 +4419,6 @@ static int msm_otg_probe(struct platform_device *pdev)
		}
	}

	pdata->system_clk = motg->core_clk;

	ret = msm_otg_bus_freq_get(motg->phy.dev, motg);
	if (ret)
		pr_err("failed to vote for explicit noc rates: %d\n", ret);
Loading