Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

authored by

Viresh Kumar and committed by
Greg Kroah-Hartman
64060fe9 5e569115

-84
-3
drivers/staging/greybus/connection.h
··· 44 44 gb_request_handler_t handler; 45 45 unsigned long flags; 46 46 47 - u8 module_major; 48 - u8 module_minor; 49 - 50 47 struct mutex mutex; 51 48 spinlock_t lock; 52 49 enum gb_connection_state state;
-27
drivers/staging/greybus/gbphy.c
··· 171 171 } 172 172 EXPORT_SYMBOL_GPL(gb_gbphy_deregister_driver); 173 173 174 - int gb_gbphy_get_version(struct gb_connection *connection) 175 - { 176 - struct gb_protocol_version_request request; 177 - struct gb_protocol_version_response response; 178 - int retval; 179 - 180 - request.major = 1; 181 - request.minor = 0; 182 - 183 - retval = gb_operation_sync(connection, GB_REQUEST_TYPE_PROTOCOL_VERSION, 184 - &request, sizeof(request), &response, 185 - sizeof(response)); 186 - if (retval) 187 - return retval; 188 - 189 - /* FIXME - do proper version negotiation here someday... */ 190 - 191 - connection->module_major = response.major; 192 - connection->module_minor = response.minor; 193 - 194 - dev_dbg(&connection->hd->dev, "%s: v%u.%u\n", connection->name, 195 - response.major, response.minor); 196 - 197 - return 0; 198 - } 199 - EXPORT_SYMBOL_GPL(gb_gbphy_get_version); 200 - 201 174 static struct gbphy_device *gb_gbphy_create_dev(struct gb_bundle *bundle, 202 175 struct greybus_descriptor_cport *cport_desc) 203 176 {
-1
drivers/staging/greybus/gbphy.h
··· 46 46 }; 47 47 #define to_gbphy_driver(d) container_of(d, struct gbphy_driver, driver) 48 48 49 - int gb_gbphy_get_version(struct gb_connection *connection); 50 49 int gb_gbphy_register_driver(struct gbphy_driver *driver, 51 50 struct module *owner, const char *mod_name); 52 51 void gb_gbphy_deregister_driver(struct gbphy_driver *driver);
-4
drivers/staging/greybus/gpio.c
··· 654 654 if (ret) 655 655 goto exit_connection_destroy; 656 656 657 - ret = gb_gbphy_get_version(connection); 658 - if (ret) 659 - goto exit_connection_disable; 660 - 661 657 ret = gb_gpio_controller_setup(ggc); 662 658 if (ret) 663 659 goto exit_connection_disable;
-25
drivers/staging/greybus/greybus_protocols.h
··· 97 97 98 98 /* Generic request types */ 99 99 #define GB_REQUEST_TYPE_PING 0x00 100 - #define GB_REQUEST_TYPE_PROTOCOL_VERSION 0x01 101 100 #define GB_REQUEST_TYPE_INVALID 0x7f 102 101 103 102 struct gb_protocol_version_request { ··· 613 614 614 615 /* I2C */ 615 616 616 - /* Version of the Greybus i2c protocol we support */ 617 - #define GB_I2C_VERSION_MAJOR 0x00 618 - #define GB_I2C_VERSION_MINOR 0x01 619 - 620 617 /* Greybus i2c request types */ 621 618 #define GB_I2C_TYPE_FUNCTIONALITY 0x02 622 619 #define GB_I2C_TYPE_TRANSFER 0x05 ··· 648 653 649 654 650 655 /* GPIO */ 651 - 652 - /* Version of the Greybus GPIO protocol we support */ 653 - #define GB_GPIO_VERSION_MAJOR 0x00 654 - #define GB_GPIO_VERSION_MINOR 0x01 655 656 656 657 /* Greybus GPIO request types */ 657 658 #define GB_GPIO_TYPE_LINE_COUNT 0x02 ··· 748 757 749 758 /* PWM */ 750 759 751 - /* Version of the Greybus PWM protocol we support */ 752 - #define GB_PWM_VERSION_MAJOR 0x00 753 - #define GB_PWM_VERSION_MINOR 0x01 754 - 755 760 /* Greybus PWM operation types */ 756 761 #define GB_PWM_TYPE_PWM_COUNT 0x02 757 762 #define GB_PWM_TYPE_ACTIVATE 0x03 ··· 790 803 } __packed; 791 804 792 805 /* SPI */ 793 - 794 - /* Version of the Greybus spi protocol we support */ 795 - #define GB_SPI_VERSION_MAJOR 0x00 796 - #define GB_SPI_VERSION_MINOR 0x01 797 806 798 807 /* Should match up with modes in linux/spi/spi.h */ 799 808 #define GB_SPI_MODE_CPHA 0x01 /* clock phase */ ··· 1229 1246 1230 1247 /* UART */ 1231 1248 1232 - /* Version of the Greybus UART protocol we support */ 1233 - #define GB_UART_VERSION_MAJOR 0x00 1234 - #define GB_UART_VERSION_MINOR 0x01 1235 - 1236 1249 /* Greybus UART operation types */ 1237 1250 #define GB_UART_TYPE_SEND_DATA 0x02 1238 1251 #define GB_UART_TYPE_RECEIVE_DATA 0x03 /* Unsolicited data */ ··· 1335 1356 } __packed; 1336 1357 1337 1358 /* SDIO */ 1338 - /* Version of the Greybus sdio protocol we support */ 1339 - #define GB_SDIO_VERSION_MAJOR 0x00 1340 - #define GB_SDIO_VERSION_MINOR 0x01 1341 - 1342 1359 /* Greybus SDIO operation types */ 1343 1360 #define GB_SDIO_TYPE_GET_CAPABILITIES 0x02 1344 1361 #define GB_SDIO_TYPE_SET_IOS 0x03
-4
drivers/staging/greybus/i2c.c
··· 271 271 if (ret) 272 272 goto exit_connection_destroy; 273 273 274 - ret = gb_gbphy_get_version(connection); 275 - if (ret) 276 - goto exit_connection_disable; 277 - 278 274 ret = gb_i2c_device_setup(gb_i2c_dev); 279 275 if (ret) 280 276 goto exit_connection_disable;
-4
drivers/staging/greybus/pwm.c
··· 206 206 if (ret) 207 207 goto exit_connection_destroy; 208 208 209 - ret = gb_gbphy_get_version(connection); 210 - if (ret) 211 - goto exit_connection_disable; 212 - 213 209 /* Query number of pwms present */ 214 210 ret = gb_pwm_count_operation(pwmc); 215 211 if (ret)
-4
drivers/staging/greybus/sdio.c
··· 748 748 if (ret) 749 749 goto exit_connection_destroy; 750 750 751 - ret = gb_gbphy_get_version(connection); 752 - if (ret) 753 - goto exit_connection_disable; 754 - 755 751 ret = gb_sdio_get_caps(host); 756 752 if (ret < 0) 757 753 goto exit_connection_disable;
-4
drivers/staging/greybus/spi.c
··· 29 29 if (ret) 30 30 goto exit_connection_destroy; 31 31 32 - ret = gb_gbphy_get_version(connection); 33 - if (ret) 34 - goto exit_connection_disable; 35 - 36 32 ret = gb_spilib_master_init(connection, &gbphy_dev->dev); 37 33 if (ret) 38 34 goto exit_connection_disable;
-4
drivers/staging/greybus/uart.c
··· 904 904 if (retval) 905 905 goto exit_release_minor; 906 906 907 - retval = gb_gbphy_get_version(connection); 908 - if (retval) 909 - goto exit_connection_disable; 910 - 911 907 send_control(gb_tty, gb_tty->ctrlout); 912 908 913 909 /* initialize the uart to be 9600n81 */
-4
drivers/staging/greybus/usb.c
··· 190 190 if (retval) 191 191 goto exit_connection_destroy; 192 192 193 - retval = gb_gbphy_get_version(connection); 194 - if (retval) 195 - goto exit_connection_disable; 196 - 197 193 /* 198 194 * FIXME: The USB bridged-PHY protocol driver depends on changes to 199 195 * USB core which are not yet upstream.