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

Commit d00d7690 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: gadget: qti: Add support for remote wakeup capability"

parents 26e4336b 6a0bd9aa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ Required subnode properties:
- qcom,composition: List of configurations where each is separated by '|'.
	And each configuration has comma separated list of functions
	specified as: <f1_name>.<f1_instance_name>,<f2_name>....
- qcom,bmAttributes: Config characteritics of composite device.
	e.g. remote wakeup capability, self or bus powered.

Optional properties:
- qcom,default-pid: ProductId to be used by composite device.
@@ -30,4 +32,10 @@ Example:
			qcom,pid = <0x9105>;
			qcom,composition = "diag.diag,gsi.dpl";
		};

		composition3 {
			qcom,pid = <0x9063>;
			qcom,composition = "gsi.rndis|gsi.ecm|gsi.mbim";
			qcom,bmAttributes = <0xa0>;
		};
	};
+9 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ struct qti_usb_gadget {
	const char *composition_funcs;
	bool enabled;
	struct device *dev;
	struct device_node *cfg_node;
};

extern char *saved_command_line;
@@ -348,7 +349,7 @@ static int qti_usb_config_add(struct qti_usb_gadget *gadget,
				  const char *name, u8 num)
{
	struct qti_usb_config *qcfg;
	int ret = 0;
	int ret = 0, val = 0;

	qcfg = kzalloc(sizeof(*qcfg), GFP_KERNEL);
	if (!qcfg)
@@ -362,6 +363,11 @@ static int qti_usb_config_add(struct qti_usb_gadget *gadget,
	qcfg->c.bConfigurationValue = num;
	qcfg->c.bmAttributes = USB_CONFIG_ATT_ONE;
	qcfg->c.MaxPower = CONFIG_USB_GADGET_VBUS_DRAW;

	ret = of_property_read_u32(gadget->cfg_node, "qcom,bmAttributes", &val);
	if (!ret)
		qcfg->c.bmAttributes = (u8)val;

	INIT_LIST_HEAD(&qcfg->func_list);
	INIT_LIST_HEAD(&qcfg->qti_funcs);

@@ -535,6 +541,8 @@ static int qti_gadget_get_properties(struct qti_usb_gadget *gadget)
		if (val == pid) {
			of_property_read_string(child, "qcom,composition",
					&gadget->composition_funcs);

			gadget->cfg_node = child;
			break;
		}
	}