diff options
author | Eugen Hristev <eugen.hristev@microchip.com> | 2019-09-11 10:24:31 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-10-24 20:25:09 +0200 |
commit | 2be357af5fdd9fc74d28d929a9e29d2fcee75e4a (patch) | |
tree | 37ce4c43b9d8f5da196f7e387f78f7110256a228 /drivers/i2c/busses/i2c-at91.h | |
parent | i2c: at91: add support for digital filtering (diff) | |
download | linux-2be357af5fdd9fc74d28d929a9e29d2fcee75e4a.tar.xz linux-2be357af5fdd9fc74d28d929a9e29d2fcee75e4a.zip |
i2c: at91: add support for advanced digital filtering
Add new platform data support for advanced digital filtering for i2c.
The sama5d2 and sam9x60 support this feature.
This digital filter allows the user to configure the maximum
width of the spikes that can be filtered.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-at91.h')
-rw-r--r-- | drivers/i2c/busses/i2c-at91.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-at91.h b/drivers/i2c/busses/i2c-at91.h index c75447ec3acd..d7cf01e32282 100644 --- a/drivers/i2c/busses/i2c-at91.h +++ b/drivers/i2c/busses/i2c-at91.h @@ -86,6 +86,9 @@ #define AT91_TWI_FILTR 0x0044 #define AT91_TWI_FILTR_FILT BIT(0) +#define AT91_TWI_FILTR_THRES(v) ((v) << 8) +#define AT91_TWI_FILTR_THRES_MAX 7 +#define AT91_TWI_FILTR_THRES_MASK GENMASK(10, 8) #define AT91_TWI_FMR 0x0050 /* FIFO Mode Register */ #define AT91_TWI_FMR_TXRDYM(mode) (((mode) & 0x3) << 0) @@ -112,6 +115,7 @@ struct at91_twi_pdata { bool has_alt_cmd; bool has_hold_field; bool has_dig_filtr; + bool has_adv_dig_filtr; struct at_dma_slave dma_slave; }; @@ -150,6 +154,7 @@ struct at91_twi_dev { struct i2c_client *slave; #endif bool enable_dig_filt; + u32 filter_width; }; unsigned at91_twi_read(struct at91_twi_dev *dev, unsigned reg); |