greybus: spi: move chipselect to one byte size

Fixed in the specification, some values for chipselect count and index
were different in size, just fix that for all reference to chipselect
and move all to one byte size and remove byte order operations.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Rui Miguel Silva 2015-12-10 14:24:58 +00:00 committed by Greg Kroah-Hartman
parent a75fd8ba5c
commit 50014e0774
2 changed files with 7 additions and 7 deletions

View File

@ -662,11 +662,11 @@ struct gb_spi_master_config_response {
__le32 max_speed_hz; __le32 max_speed_hz;
__le16 mode; __le16 mode;
__le16 flags; __le16 flags;
__le16 num_chipselect; __u8 num_chipselect;
} __packed; } __packed;
struct gb_spi_device_config_request { struct gb_spi_device_config_request {
__le16 chip_select; __u8 chip_select;
} __packed; } __packed;
struct gb_spi_device_config_response { struct gb_spi_device_config_response {

View File

@ -20,7 +20,7 @@ struct gb_spi {
u16 mode; u16 mode;
u16 flags; u16 flags;
u32 bits_per_word_mask; u32 bits_per_word_mask;
u16 num_chipselect; u8 num_chipselect;
u32 min_speed_hz; u32 min_speed_hz;
u32 max_speed_hz; u32 max_speed_hz;
struct spi_device *spi_devices; struct spi_device *spi_devices;
@ -270,7 +270,7 @@ static int gb_spi_get_master_config(struct gb_spi *spi)
spi->flags = gb_spi_flags_map(flags); spi->flags = gb_spi_flags_map(flags);
spi->bits_per_word_mask = le32_to_cpu(response.bits_per_word_mask); spi->bits_per_word_mask = le32_to_cpu(response.bits_per_word_mask);
spi->num_chipselect = le16_to_cpu(response.num_chipselect); spi->num_chipselect = response.num_chipselect;
spi->min_speed_hz = le32_to_cpu(response.min_speed_hz); spi->min_speed_hz = le32_to_cpu(response.min_speed_hz);
spi->max_speed_hz = le32_to_cpu(response.max_speed_hz); spi->max_speed_hz = le32_to_cpu(response.max_speed_hz);
@ -278,7 +278,7 @@ static int gb_spi_get_master_config(struct gb_spi *spi)
return 0; return 0;
} }
static int gb_spi_setup_device(struct gb_spi *spi, uint16_t cs) static int gb_spi_setup_device(struct gb_spi *spi, u8 cs)
{ {
struct spi_master *master = get_master_from_spi(spi); struct spi_master *master = get_master_from_spi(spi);
struct gb_spi_device_config_request request; struct gb_spi_device_config_request request;
@ -287,7 +287,7 @@ static int gb_spi_setup_device(struct gb_spi *spi, uint16_t cs)
struct spi_device *spidev = &spi->spi_devices[cs]; struct spi_device *spidev = &spi->spi_devices[cs];
int ret; int ret;
request.chip_select = cpu_to_le16(cs); request.chip_select = cs;
ret = gb_operation_sync(spi->connection, GB_SPI_TYPE_DEVICE_CONFIG, ret = gb_operation_sync(spi->connection, GB_SPI_TYPE_DEVICE_CONFIG,
&request, sizeof(request), &request, sizeof(request),
@ -331,7 +331,7 @@ static int gb_spi_connection_init(struct gb_connection *connection)
struct gb_spi *spi; struct gb_spi *spi;
struct spi_master *master; struct spi_master *master;
int ret; int ret;
int i; u8 i;
/* Allocate master with space for data */ /* Allocate master with space for data */
master = spi_alloc_master(&connection->bundle->dev, sizeof(*spi)); master = spi_alloc_master(&connection->bundle->dev, sizeof(*spi));