Commit 64060fe9 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: gbphy: Remove protocol specific version handling

We should be using the generic version handling at bundle level, instead
of at protocol level for bridged PHY devices as well.

The bundle version handling is already in place, though it is *not* used
today as we haven't bumped the version of control protocol yet.

Remove protocol specific handling for bridged PHY devices.

Tested on EVT 1.5 with gpbridge-test module. No nuttx changes are
required with this.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 5e569115
...@@ -44,9 +44,6 @@ struct gb_connection { ...@@ -44,9 +44,6 @@ struct gb_connection {
gb_request_handler_t handler; gb_request_handler_t handler;
unsigned long flags; unsigned long flags;
u8 module_major;
u8 module_minor;
struct mutex mutex; struct mutex mutex;
spinlock_t lock; spinlock_t lock;
enum gb_connection_state state; enum gb_connection_state state;
......
...@@ -171,33 +171,6 @@ void gb_gbphy_deregister_driver(struct gbphy_driver *driver) ...@@ -171,33 +171,6 @@ void gb_gbphy_deregister_driver(struct gbphy_driver *driver)
} }
EXPORT_SYMBOL_GPL(gb_gbphy_deregister_driver); EXPORT_SYMBOL_GPL(gb_gbphy_deregister_driver);
int gb_gbphy_get_version(struct gb_connection *connection)
{
struct gb_protocol_version_request request;
struct gb_protocol_version_response response;
int retval;
request.major = 1;
request.minor = 0;
retval = gb_operation_sync(connection, GB_REQUEST_TYPE_PROTOCOL_VERSION,
&request, sizeof(request), &response,
sizeof(response));
if (retval)
return retval;
/* FIXME - do proper version negotiation here someday... */
connection->module_major = response.major;
connection->module_minor = response.minor;
dev_dbg(&connection->hd->dev, "%s: v%u.%u\n", connection->name,
response.major, response.minor);
return 0;
}
EXPORT_SYMBOL_GPL(gb_gbphy_get_version);
static struct gbphy_device *gb_gbphy_create_dev(struct gb_bundle *bundle, static struct gbphy_device *gb_gbphy_create_dev(struct gb_bundle *bundle,
struct greybus_descriptor_cport *cport_desc) struct greybus_descriptor_cport *cport_desc)
{ {
......
...@@ -46,7 +46,6 @@ struct gbphy_driver { ...@@ -46,7 +46,6 @@ struct gbphy_driver {
}; };
#define to_gbphy_driver(d) container_of(d, struct gbphy_driver, driver) #define to_gbphy_driver(d) container_of(d, struct gbphy_driver, driver)
int gb_gbphy_get_version(struct gb_connection *connection);
int gb_gbphy_register_driver(struct gbphy_driver *driver, int gb_gbphy_register_driver(struct gbphy_driver *driver,
struct module *owner, const char *mod_name); struct module *owner, const char *mod_name);
void gb_gbphy_deregister_driver(struct gbphy_driver *driver); void gb_gbphy_deregister_driver(struct gbphy_driver *driver);
......
...@@ -654,10 +654,6 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev, ...@@ -654,10 +654,6 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
if (ret) if (ret)
goto exit_connection_destroy; goto exit_connection_destroy;
ret = gb_gbphy_get_version(connection);
if (ret)
goto exit_connection_disable;
ret = gb_gpio_controller_setup(ggc); ret = gb_gpio_controller_setup(ggc);
if (ret) if (ret)
goto exit_connection_disable; goto exit_connection_disable;
......
...@@ -97,7 +97,6 @@ struct gb_operation_msg_hdr { ...@@ -97,7 +97,6 @@ struct gb_operation_msg_hdr {
/* Generic request types */ /* Generic request types */
#define GB_REQUEST_TYPE_PING 0x00 #define GB_REQUEST_TYPE_PING 0x00
#define GB_REQUEST_TYPE_PROTOCOL_VERSION 0x01
#define GB_REQUEST_TYPE_INVALID 0x7f #define GB_REQUEST_TYPE_INVALID 0x7f
struct gb_protocol_version_request { struct gb_protocol_version_request {
...@@ -614,10 +613,6 @@ struct gb_hid_input_report_request { ...@@ -614,10 +613,6 @@ struct gb_hid_input_report_request {
/* I2C */ /* I2C */
/* Version of the Greybus i2c protocol we support */
#define GB_I2C_VERSION_MAJOR 0x00
#define GB_I2C_VERSION_MINOR 0x01
/* Greybus i2c request types */ /* Greybus i2c request types */
#define GB_I2C_TYPE_FUNCTIONALITY 0x02 #define GB_I2C_TYPE_FUNCTIONALITY 0x02
#define GB_I2C_TYPE_TRANSFER 0x05 #define GB_I2C_TYPE_TRANSFER 0x05
...@@ -654,10 +649,6 @@ struct gb_i2c_transfer_response { ...@@ -654,10 +649,6 @@ struct gb_i2c_transfer_response {
/* GPIO */ /* GPIO */
/* Version of the Greybus GPIO protocol we support */
#define GB_GPIO_VERSION_MAJOR 0x00
#define GB_GPIO_VERSION_MINOR 0x01
/* Greybus GPIO request types */ /* Greybus GPIO request types */
#define GB_GPIO_TYPE_LINE_COUNT 0x02 #define GB_GPIO_TYPE_LINE_COUNT 0x02
#define GB_GPIO_TYPE_ACTIVATE 0x03 #define GB_GPIO_TYPE_ACTIVATE 0x03
...@@ -757,10 +748,6 @@ struct gb_gpio_irq_event_request { ...@@ -757,10 +748,6 @@ struct gb_gpio_irq_event_request {
/* PWM */ /* PWM */
/* Version of the Greybus PWM protocol we support */
#define GB_PWM_VERSION_MAJOR 0x00
#define GB_PWM_VERSION_MINOR 0x01
/* Greybus PWM operation types */ /* Greybus PWM operation types */
#define GB_PWM_TYPE_PWM_COUNT 0x02 #define GB_PWM_TYPE_PWM_COUNT 0x02
#define GB_PWM_TYPE_ACTIVATE 0x03 #define GB_PWM_TYPE_ACTIVATE 0x03
...@@ -804,10 +791,6 @@ struct gb_pwm_disable_request { ...@@ -804,10 +791,6 @@ struct gb_pwm_disable_request {
/* SPI */ /* SPI */
/* Version of the Greybus spi protocol we support */
#define GB_SPI_VERSION_MAJOR 0x00
#define GB_SPI_VERSION_MINOR 0x01
/* Should match up with modes in linux/spi/spi.h */ /* Should match up with modes in linux/spi/spi.h */
#define GB_SPI_MODE_CPHA 0x01 /* clock phase */ #define GB_SPI_MODE_CPHA 0x01 /* clock phase */
#define GB_SPI_MODE_CPOL 0x02 /* clock polarity */ #define GB_SPI_MODE_CPOL 0x02 /* clock polarity */
...@@ -1246,10 +1229,6 @@ struct gb_raw_send_request { ...@@ -1246,10 +1229,6 @@ struct gb_raw_send_request {
/* UART */ /* UART */
/* Version of the Greybus UART protocol we support */
#define GB_UART_VERSION_MAJOR 0x00
#define GB_UART_VERSION_MINOR 0x01
/* Greybus UART operation types */ /* Greybus UART operation types */
#define GB_UART_TYPE_SEND_DATA 0x02 #define GB_UART_TYPE_SEND_DATA 0x02
#define GB_UART_TYPE_RECEIVE_DATA 0x03 /* Unsolicited data */ #define GB_UART_TYPE_RECEIVE_DATA 0x03 /* Unsolicited data */
...@@ -1356,10 +1335,6 @@ struct gb_loopback_transfer_response { ...@@ -1356,10 +1335,6 @@ struct gb_loopback_transfer_response {
} __packed; } __packed;
/* SDIO */ /* SDIO */
/* Version of the Greybus sdio protocol we support */
#define GB_SDIO_VERSION_MAJOR 0x00
#define GB_SDIO_VERSION_MINOR 0x01
/* Greybus SDIO operation types */ /* Greybus SDIO operation types */
#define GB_SDIO_TYPE_GET_CAPABILITIES 0x02 #define GB_SDIO_TYPE_GET_CAPABILITIES 0x02
#define GB_SDIO_TYPE_SET_IOS 0x03 #define GB_SDIO_TYPE_SET_IOS 0x03
......
...@@ -271,10 +271,6 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev, ...@@ -271,10 +271,6 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev,
if (ret) if (ret)
goto exit_connection_destroy; goto exit_connection_destroy;
ret = gb_gbphy_get_version(connection);
if (ret)
goto exit_connection_disable;
ret = gb_i2c_device_setup(gb_i2c_dev); ret = gb_i2c_device_setup(gb_i2c_dev);
if (ret) if (ret)
goto exit_connection_disable; goto exit_connection_disable;
......
...@@ -206,10 +206,6 @@ static int gb_pwm_probe(struct gbphy_device *gbphy_dev, ...@@ -206,10 +206,6 @@ static int gb_pwm_probe(struct gbphy_device *gbphy_dev,
if (ret) if (ret)
goto exit_connection_destroy; goto exit_connection_destroy;
ret = gb_gbphy_get_version(connection);
if (ret)
goto exit_connection_disable;
/* Query number of pwms present */ /* Query number of pwms present */
ret = gb_pwm_count_operation(pwmc); ret = gb_pwm_count_operation(pwmc);
if (ret) if (ret)
......
...@@ -748,10 +748,6 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev, ...@@ -748,10 +748,6 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev,
if (ret) if (ret)
goto exit_connection_destroy; goto exit_connection_destroy;
ret = gb_gbphy_get_version(connection);
if (ret)
goto exit_connection_disable;
ret = gb_sdio_get_caps(host); ret = gb_sdio_get_caps(host);
if (ret < 0) if (ret < 0)
goto exit_connection_disable; goto exit_connection_disable;
......
...@@ -29,10 +29,6 @@ static int gb_spi_probe(struct gbphy_device *gbphy_dev, ...@@ -29,10 +29,6 @@ static int gb_spi_probe(struct gbphy_device *gbphy_dev,
if (ret) if (ret)
goto exit_connection_destroy; goto exit_connection_destroy;
ret = gb_gbphy_get_version(connection);
if (ret)
goto exit_connection_disable;
ret = gb_spilib_master_init(connection, &gbphy_dev->dev); ret = gb_spilib_master_init(connection, &gbphy_dev->dev);
if (ret) if (ret)
goto exit_connection_disable; goto exit_connection_disable;
......
...@@ -904,10 +904,6 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev, ...@@ -904,10 +904,6 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
if (retval) if (retval)
goto exit_release_minor; goto exit_release_minor;
retval = gb_gbphy_get_version(connection);
if (retval)
goto exit_connection_disable;
send_control(gb_tty, gb_tty->ctrlout); send_control(gb_tty, gb_tty->ctrlout);
/* initialize the uart to be 9600n81 */ /* initialize the uart to be 9600n81 */
......
...@@ -190,10 +190,6 @@ static int gb_usb_probe(struct gbphy_device *gbphy_dev, ...@@ -190,10 +190,6 @@ static int gb_usb_probe(struct gbphy_device *gbphy_dev,
if (retval) if (retval)
goto exit_connection_destroy; goto exit_connection_destroy;
retval = gb_gbphy_get_version(connection);
if (retval)
goto exit_connection_disable;
/* /*
* FIXME: The USB bridged-PHY protocol driver depends on changes to * FIXME: The USB bridged-PHY protocol driver depends on changes to
* USB core which are not yet upstream. * USB core which are not yet upstream.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment