summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-at91.h
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2019-09-11 08:24:31 +0000
committerWolfram Sang <wsa@the-dreams.de>2019-10-24 20:25:09 +0200
commit2be357af5fdd9fc74d28d929a9e29d2fcee75e4a (patch)
tree37ce4c43b9d8f5da196f7e387f78f7110256a228 /drivers/i2c/busses/i2c-at91.h
parent2989b45923b96981a3f50be7f64afdf9221c3b17 (diff)
downloadlinux-stable-2be357af5fdd9fc74d28d929a9e29d2fcee75e4a.tar.gz
linux-stable-2be357af5fdd9fc74d28d929a9e29d2fcee75e4a.tar.bz2
linux-stable-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.h5
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);