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

Commit e0c38117 authored by Jack Pham's avatar Jack Pham Committed by Matt Wagantall
Browse files

usb: gadget: android: Add snapshot of changes



Add snapshot of changes to android.c from msm-3.14. Some of
these changes also touch gadget.h, composite.c and udc-core.c
necessarily due to subsystem coupling.

The is a squash of the following commits:

usb: gadget: allow android gadget to bind/unbind several times
USB: android: strim serial number buffer
USB: android: Avoid typecasting sysfs buffer
usb: gadget: Vote for SWFI when USB cable is connected
USB: android: Fix missing USB DISCONNECT uevent
USB: android: Provide sysfs file for enabling remote wakeup capability
usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW
USB: Trival cleanup in MSM drivers
usb: gadget: android: set max speed to Super Speed
usb: gadget: android: Set usb_core_id if exists
usb: gadget: Allow PID and serial_num update on DT-targets
usb: gadget: Add support for multiple android gadgets
usb: gadget: Add support for more than one configuration in android gadget
usb: android: Add support for voting against APPS idle standalone PC
usb: gadget: Handle function control requests before set config
usb: gadget: Allow function drivers to exist in multiple configurations
usb: gadget: android gadget vote for pm_qos also on suspend/resume
usb: gadget: android: Defer probe if UDC not found
USB: android: Add delay before enabling audio source function
USB: android: Rate limit android enable warning
USB: android: Handle error conditions if usb_add_config fails
USB: android: Prevent change of host mac address of 'rndis0' interface
usb/gadget: android: Handle NULL pointer dereference in android_probe()
usb: gadget: Match gadget and gadget_driver according to usb_core_id
USB: gadget: Add support to enable streaming mode with required function
USB: android: Add support to get usb-core-id using devicetree
usb_bam: changes for HSIC IPA functionality
usb: gadget: change the minor number for android functions
USB: ANDROID: Implement dynamic pm_qos voting based on USB activity

Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent c9cb18c4
Loading
Loading
Loading
Loading
+1064 −180

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -1043,6 +1043,11 @@ void usb_remove_config(struct usb_composite_dev *cdev,

	spin_lock_irqsave(&cdev->lock, flags);

	if (WARN_ON(!config->cdev)) {
		spin_unlock_irqrestore(&cdev->lock, flags);
		return;
	}

	if (cdev->config == config)
		reset_config(cdev);

+3 −2
Original line number Diff line number Diff line
@@ -465,8 +465,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver)

	mutex_lock(&udc_lock);
	list_for_each_entry(udc, &udc_list, list) {
		/* For now we take the first one */
		if (!udc->driver)
		/* Match according to usb_core_id */
		if (!udc->driver && udc->gadget
		    && udc->gadget->usb_core_id == driver->usb_core_id)
			goto found;
	}

+32 −0
Original line number Diff line number Diff line
/* Copyright (c) 2012, 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
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __LINUX_DIAG_DLOAD_H__
#define __LINUX_DIAG_DLOAD_H__


#define PID_MAGIC_ID		0x71432909
#define SERIAL_NUM_MAGIC_ID	0x61945374
#define SERIAL_NUMBER_LENGTH	128

struct magic_num_struct {
	uint32_t pid;
	uint32_t serial_num;
};

struct dload_struct {
	uint32_t	pid;
	char		serial_number[SERIAL_NUMBER_LENGTH];
	struct magic_num_struct magic_struct;
};

#endif
+39 −0
Original line number Diff line number Diff line
/*
 * Platform data for Android USB
 *
 * Copyright (C) 2008 Google, Inc.
 * Author: Mike Lockwood <lockwood@android.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#ifndef	__LINUX_USB_ANDROID_H
#define	__LINUX_USB_ANDROID_H

#define MAX_STREAMING_FUNCS 3
#define FUNC_NAME_LEN 10

enum android_pm_qos_state {
	WFI,
	IDLE_PC,
	IDLE_PC_RPM,
	NO_USB_VOTE,
	MAX_VOTES = NO_USB_VOTE,
};

struct android_usb_platform_data {
	int (*update_pid_and_serial_num)(uint32_t, const char *);
	u32 pm_qos_latency[MAX_VOTES];
	u8 usb_core_id;
	char streaming_func[MAX_STREAMING_FUNCS][FUNC_NAME_LEN];
	int  streaming_func_count;
};

#endif	/* __LINUX_USB_ANDROID_H */
Loading