* [PATCH tty-next 1/3] hid-ft260: Cleanup macro formatting
2022-12-07 21:55 [PATCH tty-next 0/3] hid-ft260 cleanups Christina Quast
@ 2022-12-07 21:55 ` Christina Quast
2022-12-08 7:11 ` Greg Kroah-Hartman
2022-12-07 21:55 ` [PATCH tty-next 2/3] hid-ft260: Rename struct ft260_i2c_input_report Christina Quast
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Christina Quast @ 2022-12-07 21:55 UTC (permalink / raw)
To: linux-serial
Cc: Christina Quast, Ilpo Järvinen, Daniel Beer,
Greg Kroah-Hartman
Signed-off-by: Christina Quast <contact@christina-quast.de>
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Daniel Beer <daniel.beer@igorinstitute.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-ft260.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index 79505c64dbfe..7edba9aaff43 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -29,7 +29,8 @@ MODULE_PARM_DESC(debug, "Toggle FT260 debugging messages");
} while (0)
#define FT260_REPORT_MAX_LENGTH (64)
-#define FT260_I2C_DATA_REPORT_ID(len) (FT260_I2C_REPORT_MIN + (len - 1) / 4)
+#define FT260_I2C_DATA_REPORT_ID(len) (FT260_I2C_REPORT_MIN + ((len) - 1) / 4)
+
/*
* The input report format assigns 62 bytes for the data payload, but ft260
* returns 60 and 2 in two separate transactions. To minimize transfer time
@@ -123,7 +124,7 @@ enum {
FT260_FLAG_START_STOP_REPEATED = 0x07,
};
-#define FT260_SET_REQUEST_VALUE(report_id) ((FT260_FEATURE << 8) | report_id)
+#define FT260_SET_REQUEST_VALUE(report_id) ((FT260_FEATURE << 8) | (report_id))
/* Feature In reports */
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH tty-next 2/3] hid-ft260: Rename struct ft260_i2c_input_report
2022-12-07 21:55 [PATCH tty-next 0/3] hid-ft260 cleanups Christina Quast
2022-12-07 21:55 ` [PATCH tty-next 1/3] hid-ft260: Cleanup macro formatting Christina Quast
@ 2022-12-07 21:55 ` Christina Quast
2022-12-07 21:55 ` [PATCH tty-next 3/3] hid-ft260: Change u8 to __u8 for hw facing structs Christina Quast
2022-12-08 7:11 ` [PATCH tty-next 0/3] hid-ft260 cleanups Greg Kroah-Hartman
3 siblings, 0 replies; 6+ messages in thread
From: Christina Quast @ 2022-12-07 21:55 UTC (permalink / raw)
To: linux-serial
Cc: Christina Quast, Ilpo Järvinen, Daniel Beer,
Greg Kroah-Hartman
Signed-off-by: Christina Quast <contact@christina-quast.de>
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Daniel Beer <daniel.beer@igorinstitute.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-ft260.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index 7edba9aaff43..59b6cab13946 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -212,8 +212,8 @@ struct ft260_i2c_read_request_report {
__le16 length; /* data payload length */
} __packed;
-struct ft260_i2c_input_report {
- u8 report; /* FT260_I2C_REPORT */
+struct ft260_input_report {
+ u8 report; /* FT260_I2C_REPORT or FT260_UART_REPORT */
u8 length; /* data payload length */
u8 data[2]; /* data payload */
} __packed;
@@ -1016,7 +1016,7 @@ static int ft260_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size)
{
struct ft260_device *dev = hid_get_drvdata(hdev);
- struct ft260_i2c_input_report *xfer = (void *)data;
+ struct ft260_input_report *xfer = (void *)data;
if (xfer->report >= FT260_I2C_REPORT_MIN &&
xfer->report <= FT260_I2C_REPORT_MAX) {
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH tty-next 3/3] hid-ft260: Change u8 to __u8 for hw facing structs
2022-12-07 21:55 [PATCH tty-next 0/3] hid-ft260 cleanups Christina Quast
2022-12-07 21:55 ` [PATCH tty-next 1/3] hid-ft260: Cleanup macro formatting Christina Quast
2022-12-07 21:55 ` [PATCH tty-next 2/3] hid-ft260: Rename struct ft260_i2c_input_report Christina Quast
@ 2022-12-07 21:55 ` Christina Quast
2022-12-08 7:11 ` [PATCH tty-next 0/3] hid-ft260 cleanups Greg Kroah-Hartman
3 siblings, 0 replies; 6+ messages in thread
From: Christina Quast @ 2022-12-07 21:55 UTC (permalink / raw)
To: linux-serial
Cc: Christina Quast, Ilpo Järvinen, Daniel Beer,
Greg Kroah-Hartman
Signed-off-by: Christina Quast <contact@christina-quast.de>
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Daniel Beer <daniel.beer@igorinstitute.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-ft260.c | 92 ++++++++++++++++++++---------------------
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index 59b6cab13946..8979f85a1ac3 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -129,93 +129,93 @@ enum {
/* Feature In reports */
struct ft260_get_chip_version_report {
- u8 report; /* FT260_CHIP_VERSION */
- u8 chip_code[4]; /* FTDI chip identification code */
- u8 reserved[8];
+ __u8 report; /* FT260_CHIP_VERSION */
+ __u8 chip_code[4]; /* FTDI chip identification code */
+ __u8 reserved[8];
} __packed;
struct ft260_get_system_status_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 chip_mode; /* DCNF0 and DCNF1 status, bits 0-1 */
- u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
- u8 suspend_status; /* 0 - not suspended, 1 - suspended */
- u8 pwren_status; /* 0 - FT260 is not ready, 1 - ready */
- u8 i2c_enable; /* 0 - disabled, 1 - enabled */
- u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 chip_mode; /* DCNF0 and DCNF1 status, bits 0-1 */
+ __u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
+ __u8 suspend_status; /* 0 - not suspended, 1 - suspended */
+ __u8 pwren_status; /* 0 - FT260 is not ready, 1 - ready */
+ __u8 i2c_enable; /* 0 - disabled, 1 - enabled */
+ __u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
/* 3 - XON_XOFF, 4 - No flow control */
- u8 hid_over_i2c_en; /* 0 - disabled, 1 - enabled */
- u8 gpio2_function; /* 0 - GPIO, 1 - SUSPOUT, */
+ __u8 hid_over_i2c_en; /* 0 - disabled, 1 - enabled */
+ __u8 gpio2_function; /* 0 - GPIO, 1 - SUSPOUT, */
/* 2 - PWREN, 4 - TX_LED */
- u8 gpioA_function; /* 0 - GPIO, 3 - TX_ACTIVE, 4 - TX_LED */
- u8 gpioG_function; /* 0 - GPIO, 2 - PWREN, */
+ __u8 gpioA_function; /* 0 - GPIO, 3 - TX_ACTIVE, 4 - TX_LED */
+ __u8 gpioG_function; /* 0 - GPIO, 2 - PWREN, */
/* 5 - RX_LED, 6 - BCD_DET */
- u8 suspend_out_pol; /* 0 - active-high, 1 - active-low */
- u8 enable_wakeup_int; /* 0 - disabled, 1 - enabled */
- u8 intr_cond; /* Interrupt trigger conditions */
- u8 power_saving_en; /* 0 - disabled, 1 - enabled */
- u8 reserved[10];
+ __u8 suspend_out_pol; /* 0 - active-high, 1 - active-low */
+ __u8 enable_wakeup_int; /* 0 - disabled, 1 - enabled */
+ __u8 intr_cond; /* Interrupt trigger conditions */
+ __u8 power_saving_en; /* 0 - disabled, 1 - enabled */
+ __u8 reserved[10];
} __packed;
struct ft260_get_i2c_status_report {
- u8 report; /* FT260_I2C_STATUS */
- u8 bus_status; /* I2C bus status */
+ __u8 report; /* FT260_I2C_STATUS */
+ __u8 bus_status; /* I2C bus status */
__le16 clock; /* I2C bus clock in range 60-3400 KHz */
- u8 reserved;
+ __u8 reserved;
} __packed;
/* Feature Out reports */
struct ft260_set_system_clock_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 request; /* FT260_SET_CLOCK */
- u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 request; /* FT260_SET_CLOCK */
+ __u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
} __packed;
struct ft260_set_i2c_mode_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 request; /* FT260_SET_I2C_MODE */
- u8 i2c_enable; /* 0 - disabled, 1 - enabled */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 request; /* FT260_SET_I2C_MODE */
+ __u8 i2c_enable; /* 0 - disabled, 1 - enabled */
} __packed;
struct ft260_set_uart_mode_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 request; /* FT260_SET_UART_MODE */
- u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 request; /* FT260_SET_UART_MODE */
+ __u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
/* 3 - XON_XOFF, 4 - No flow control */
} __packed;
struct ft260_set_i2c_reset_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 request; /* FT260_SET_I2C_RESET */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 request; /* FT260_SET_I2C_RESET */
} __packed;
struct ft260_set_i2c_speed_report {
- u8 report; /* FT260_SYSTEM_SETTINGS */
- u8 request; /* FT260_SET_I2C_CLOCK_SPEED */
+ __u8 report; /* FT260_SYSTEM_SETTINGS */
+ __u8 request; /* FT260_SET_I2C_CLOCK_SPEED */
__le16 clock; /* I2C bus clock in range 60-3400 KHz */
} __packed;
/* Data transfer reports */
struct ft260_i2c_write_request_report {
- u8 report; /* FT260_I2C_REPORT */
- u8 address; /* 7-bit I2C address */
- u8 flag; /* I2C transaction condition */
- u8 length; /* data payload length */
- u8 data[FT260_WR_DATA_MAX]; /* data payload */
+ __u8 report; /* FT260_I2C_REPORT */
+ __u8 address; /* 7-bit I2C address */
+ __u8 flag; /* I2C transaction condition */
+ __u8 length; /* data payload length */
+ __u8 data[FT260_WR_DATA_MAX]; /* data payload */
} __packed;
struct ft260_i2c_read_request_report {
- u8 report; /* FT260_I2C_READ_REQ */
- u8 address; /* 7-bit I2C address */
- u8 flag; /* I2C transaction condition */
+ __u8 report; /* FT260_I2C_READ_REQ */
+ __u8 address; /* 7-bit I2C address */
+ __u8 flag; /* I2C transaction condition */
__le16 length; /* data payload length */
} __packed;
struct ft260_input_report {
- u8 report; /* FT260_I2C_REPORT or FT260_UART_REPORT */
- u8 length; /* data payload length */
- u8 data[2]; /* data payload */
+ __u8 report; /* FT260_I2C_REPORT or FT260_UART_REPORT */
+ __u8 length; /* data payload length */
+ __u8 data[2]; /* data payload */
} __packed;
static const struct hid_device_id ft260_devices[] = {
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread