#define GB_I2C_TYPE_TIMEOUT 0x03
#define GB_I2C_TYPE_RETRIES 0x04
#define GB_I2C_TYPE_TRANSFER 0x05
-#define GB_I2C_TYPE_RESPONSE 0x80 /* OR'd with rest */
#define GB_I2C_RETRIES_DEFAULT 3
#define GB_I2C_TIMEOUT_DEFAULT 1000 /* milliseconds */
#define GB_GPIO_TYPE_IRQ_MASK 0x0d
#define GB_GPIO_TYPE_IRQ_UNMASK 0x0e
#define GB_GPIO_TYPE_IRQ_EVENT 0x0f
-#define GB_GPIO_TYPE_RESPONSE 0x80 /* OR'd with rest */
#define GB_GPIO_DEBOUNCE_USEC_DEFAULT 0 /* microseconds */
#define GB_PWM_VERSION_MAJOR 0x00
#define GB_PWM_VERSION_MINOR 0x01
-/* Greybus PWM request types */
+/* Greybus PWM operation types */
#define GB_PWM_TYPE_INVALID 0x00
#define GB_PWM_TYPE_PROTOCOL_VERSION 0x01
#define GB_PWM_TYPE_PWM_COUNT 0x02
#define GB_PWM_TYPE_POLARITY 0x06
#define GB_PWM_TYPE_ENABLE 0x07
#define GB_PWM_TYPE_DISABLE 0x08
-#define GB_PWM_TYPE_RESPONSE 0x80 /* OR'd with rest */
/* pwm count request has no payload */
struct gb_pwm_count_response {
#define GB_HID_VERSION_MAJOR 0x00
#define GB_HID_VERSION_MINOR 0x01
-/* Greybus HID request types */
+/* Greybus HID operation types */
#define GB_HID_TYPE_INVALID 0x00
#define GB_HID_TYPE_PROTOCOL_VERSION 0x01
#define GB_HID_TYPE_GET_DESC 0x02
#define GB_HID_TYPE_GET_REPORT 0x06
#define GB_HID_TYPE_SET_REPORT 0x07
#define GB_HID_TYPE_IRQ_EVENT 0x08
-#define GB_HID_TYPE_RESPONSE 0x80 /* OR'd with rest */
/* Report type */
#define GB_HID_INPUT_REPORT 0
struct gb_message *response;
u8 type;
- type = operation->type | GB_OPERATION_TYPE_RESPONSE;
+ type = operation->type | GB_MESSAGE_TYPE_RESPONSE;
response = gb_operation_message_alloc(hd, type, response_size,
GFP_KERNEL);
if (!response)
{
if (WARN_ON_ONCE(type == GB_OPERATION_TYPE_INVALID))
return NULL;
- if (WARN_ON_ONCE(type & GB_OPERATION_TYPE_RESPONSE))
- type &= ~GB_OPERATION_TYPE_RESPONSE;
+ if (WARN_ON_ONCE(type & GB_MESSAGE_TYPE_RESPONSE))
+ type &= ~GB_MESSAGE_TYPE_RESPONSE;
return gb_operation_create_common(connection, type,
request_size, response_size);
}
operation_id = le16_to_cpu(header.operation_id);
- if (header.type & GB_OPERATION_TYPE_RESPONSE)
+ if (header.type & GB_MESSAGE_TYPE_RESPONSE)
gb_connection_recv_response(connection, operation_id,
header.result, data, msg_size);
else
* The top bit of the type in an operation message header indicates
* whether the message is a request (bit clear) or response (bit set)
*/
-#define GB_OPERATION_TYPE_RESPONSE ((u8)0x80)
+#define GB_MESSAGE_TYPE_RESPONSE ((u8)0x80)
enum gb_operation_result {
GB_OP_SUCCESS = 0x00,
#define GB_SPI_FLAG_NO_RX BIT(1) /* can't do buffer read */
#define GB_SPI_FLAG_NO_TX BIT(2) /* can't do buffer write */
-/* Greybus spi request types */
+/* Greybus spi operation types */
#define GB_SPI_TYPE_INVALID 0x00
#define GB_SPI_TYPE_PROTOCOL_VERSION 0x01
#define GB_SPI_TYPE_MODE 0x02
#define GB_SPI_TYPE_BITS_PER_WORD_MASK 0x04
#define GB_SPI_TYPE_NUM_CHIPSELECT 0x05
#define GB_SPI_TYPE_TRANSFER 0x06
-#define GB_SPI_TYPE_RESPONSE 0x80 /* OR'd with rest */
/* mode request has no payload */
struct gb_spi_mode_response {
#define GB_UART_VERSION_MAJOR 0x00
#define GB_UART_VERSION_MINOR 0x01
-/* Greybus UART request types */
+/* Greybus UART operation types */
#define GB_UART_TYPE_INVALID 0x00
#define GB_UART_TYPE_PROTOCOL_VERSION 0x01
#define GB_UART_TYPE_SEND_DATA 0x02
#define GB_UART_TYPE_SET_CONTROL_LINE_STATE 0x05
#define GB_UART_TYPE_SET_BREAK 0x06
#define GB_UART_TYPE_SERIAL_STATE 0x07 /* Unsolicited data */
-#define GB_UART_TYPE_RESPONSE 0x80 /* OR'd with rest */
struct gb_uart_send_data_request {
__le16 size;
#define GB_VIBRATOR_VERSION_MAJOR 0x00
#define GB_VIBRATOR_VERSION_MINOR 0x01
-/* Greybus Vibrator request types */
+/* Greybus Vibrator operation types */
#define GB_VIBRATOR_TYPE_INVALID 0x00
#define GB_VIBRATOR_TYPE_PROTOCOL_VERSION 0x01
#define GB_VIBRATOR_TYPE_ON 0x02
#define GB_VIBRATOR_TYPE_OFF 0x03
-#define GB_VIBRATOR_TYPE_RESPONSE 0x80 /* OR'd with rest */
struct gb_vibrator_on_request {
__le16 timeout_ms;