usb: gadget: rename gadget transport type
Modify the transport_type enum and rename file to reflect all supported gadget transport types not just serial. Remove reference to the old file name from some of board files and device files, as they are no longer dependent on it. Change-Id: Ic1a07382fff71e5aa2f9473a95eab8da1330b82f Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This commit is contained in:
@@ -36,7 +36,6 @@
|
|||||||
#include <mach/rpc_hsusb.h>
|
#include <mach/rpc_hsusb.h>
|
||||||
#include <mach/rpc_pmapp.h>
|
#include <mach/rpc_pmapp.h>
|
||||||
#include <mach/usbdiag.h>
|
#include <mach/usbdiag.h>
|
||||||
#include <mach/usb_gadget_fserial.h>
|
|
||||||
#include <mach/msm_memtypes.h>
|
#include <mach/msm_memtypes.h>
|
||||||
#include <mach/msm_serial_hs.h>
|
#include <mach/msm_serial_hs.h>
|
||||||
#include <mach/pmic.h>
|
#include <mach/pmic.h>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <asm/mach/mmc.h>
|
#include <asm/mach/mmc.h>
|
||||||
#include <mach/msm_hsusb.h>
|
#include <mach/msm_hsusb.h>
|
||||||
#include <mach/usbdiag.h>
|
#include <mach/usbdiag.h>
|
||||||
#include <mach/usb_gadget_fserial.h>
|
|
||||||
#include <mach/rpc_hsusb.h>
|
#include <mach/rpc_hsusb.h>
|
||||||
|
|
||||||
#include "clock-pcom.h"
|
#include "clock-pcom.h"
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include <asm/mach/mmc.h>
|
#include <asm/mach/mmc.h>
|
||||||
#include <mach/msm_hsusb.h>
|
#include <mach/msm_hsusb.h>
|
||||||
#include <mach/usbdiag.h>
|
#include <mach/usbdiag.h>
|
||||||
#include <mach/usb_gadget_fserial.h>
|
|
||||||
#include <mach/rpc_hsusb.h>
|
#include <mach/rpc_hsusb.h>
|
||||||
|
|
||||||
static struct resource resources_uart1[] = {
|
static struct resource resources_uart1[] = {
|
||||||
|
|||||||
@@ -11,16 +11,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __LINUX_USB_GADGET_FSERIAL_H__
|
#ifndef __LINUX_USB_GADGET_XPORT_H__
|
||||||
#define __LINUX_USB_GADGET_FSERIAL_H__
|
#define __LINUX_USB_GADGET_XPORT_H__
|
||||||
|
|
||||||
#include <linux/platform_device.h>
|
|
||||||
|
|
||||||
enum transport_type {
|
enum transport_type {
|
||||||
USB_GADGET_FSERIAL_TRANSPORT_TTY,
|
USB_GADGET_XPORT_NONE,
|
||||||
USB_GADGET_FSERIAL_TRANSPORT_SDIO,
|
USB_GADGET_XPORT_TTY,
|
||||||
USB_GADGET_FSERIAL_TRANSPORT_SMD,
|
USB_GADGET_XPORT_SDIO,
|
||||||
|
USB_GADGET_XPORT_SMD,
|
||||||
|
USB_GADGET_XPORT_UNDEF,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GSERIAL_NO_PORTS 2
|
|
||||||
#endif
|
#endif
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <mach/usb_gadget_fserial.h>
|
#include <mach/usb_gadget_xport.h>
|
||||||
|
|
||||||
#include "u_serial.h"
|
#include "u_serial.h"
|
||||||
#include "gadget_chips.h"
|
#include "gadget_chips.h"
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
* CDC ACM driver. However, for many purposes it's just as functional
|
* CDC ACM driver. However, for many purposes it's just as functional
|
||||||
* if you can arrange appropriate host side drivers.
|
* if you can arrange appropriate host side drivers.
|
||||||
*/
|
*/
|
||||||
|
#define GSERIAL_NO_PORTS 2
|
||||||
|
|
||||||
struct gser_descs {
|
struct gser_descs {
|
||||||
struct usb_endpoint_descriptor *in;
|
struct usb_endpoint_descriptor *in;
|
||||||
@@ -85,7 +86,7 @@ static struct port_info {
|
|||||||
|
|
||||||
static inline bool is_transport_sdio(enum transport_type t)
|
static inline bool is_transport_sdio(enum transport_type t)
|
||||||
{
|
{
|
||||||
if (t == USB_GADGET_FSERIAL_TRANSPORT_SDIO)
|
if (t == USB_GADGET_XPORT_SDIO)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -253,25 +254,25 @@ static struct usb_gadget_strings *gser_strings[] = {
|
|||||||
static char *transport_to_str(enum transport_type t)
|
static char *transport_to_str(enum transport_type t)
|
||||||
{
|
{
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_TTY:
|
case USB_GADGET_XPORT_TTY:
|
||||||
return "TTY";
|
return "TTY";
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
|
case USB_GADGET_XPORT_SDIO:
|
||||||
return "SDIO";
|
return "SDIO";
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SMD:
|
case USB_GADGET_XPORT_SMD:
|
||||||
return "SMD";
|
return "SMD";
|
||||||
}
|
default:
|
||||||
|
|
||||||
return "NONE";
|
return "NONE";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum transport_type serial_str_to_transport(const char *name)
|
static enum transport_type serial_str_to_transport(const char *name)
|
||||||
{
|
{
|
||||||
if (!strcasecmp("SDIO", name))
|
if (!strcasecmp("SDIO", name))
|
||||||
return USB_GADGET_FSERIAL_TRANSPORT_SDIO;
|
return USB_GADGET_XPORT_SDIO;
|
||||||
if (!strcasecmp("SMD", name))
|
if (!strcasecmp("SMD", name))
|
||||||
return USB_GADGET_FSERIAL_TRANSPORT_SMD;
|
return USB_GADGET_XPORT_SMD;
|
||||||
|
|
||||||
return USB_GADGET_FSERIAL_TRANSPORT_TTY;
|
return USB_GADGET_XPORT_TTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -303,13 +304,13 @@ static int gport_connect(struct f_gser *gser)
|
|||||||
port_num = gserial_ports[gser->port_num].client_port_num;
|
port_num = gserial_ports[gser->port_num].client_port_num;
|
||||||
|
|
||||||
switch (gser->transport) {
|
switch (gser->transport) {
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_TTY:
|
case USB_GADGET_XPORT_TTY:
|
||||||
gserial_connect(&gser->port, port_num);
|
gserial_connect(&gser->port, port_num);
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
|
case USB_GADGET_XPORT_SDIO:
|
||||||
gsdio_connect(&gser->port, port_num);
|
gsdio_connect(&gser->port, port_num);
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SMD:
|
case USB_GADGET_XPORT_SMD:
|
||||||
gsmd_connect(&gser->port, port_num);
|
gsmd_connect(&gser->port, port_num);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -332,13 +333,13 @@ static int gport_disconnect(struct f_gser *gser)
|
|||||||
port_num = gserial_ports[gser->port_num].client_port_num;
|
port_num = gserial_ports[gser->port_num].client_port_num;
|
||||||
|
|
||||||
switch (gser->transport) {
|
switch (gser->transport) {
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_TTY:
|
case USB_GADGET_XPORT_TTY:
|
||||||
gserial_disconnect(&gser->port);
|
gserial_disconnect(&gser->port);
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
|
case USB_GADGET_XPORT_SDIO:
|
||||||
gsdio_disconnect(&gser->port, port_num);
|
gsdio_disconnect(&gser->port, port_num);
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SMD:
|
case USB_GADGET_XPORT_SMD:
|
||||||
gsmd_disconnect(&gser->port, port_num);
|
gsmd_disconnect(&gser->port, port_num);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -895,15 +896,15 @@ static int gserial_init_port(int port_num, const char *name)
|
|||||||
gserial_ports[port_num].port_num = port_num;
|
gserial_ports[port_num].port_num = port_num;
|
||||||
|
|
||||||
switch (transport) {
|
switch (transport) {
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_TTY:
|
case USB_GADGET_XPORT_TTY:
|
||||||
gserial_ports[port_num].client_port_num = no_tty_ports;
|
gserial_ports[port_num].client_port_num = no_tty_ports;
|
||||||
no_tty_ports++;
|
no_tty_ports++;
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
|
case USB_GADGET_XPORT_SDIO:
|
||||||
gserial_ports[port_num].client_port_num = no_sdio_ports;
|
gserial_ports[port_num].client_port_num = no_sdio_ports;
|
||||||
no_sdio_ports++;
|
no_sdio_ports++;
|
||||||
break;
|
break;
|
||||||
case USB_GADGET_FSERIAL_TRANSPORT_SMD:
|
case USB_GADGET_XPORT_SMD:
|
||||||
gserial_ports[port_num].client_port_num = no_smd_ports;
|
gserial_ports[port_num].client_port_num = no_smd_ports;
|
||||||
no_smd_ports++;
|
no_smd_ports++;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user