diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2018-02-12 12:21:11 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-03-28 18:31:28 +0200 |
commit | e83f0920de7882d09816c57a1e78e253cc3dcd7c (patch) | |
tree | 61ce6651ef21c8d4469f363942254326b8a2d15c /include | |
parent | e2479101d95625c1c2fcb7c8f72fe515d9099cc1 (diff) |
can: mfd: apalis-tk1: v1.1 frequency adjustments and various fixes
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/apalis-tk1-k20.h | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/include/linux/mfd/apalis-tk1-k20.h b/include/linux/mfd/apalis-tk1-k20.h index ca9025d63cb1..ba2afdc8dbc4 100644 --- a/include/linux/mfd/apalis-tk1-k20.h +++ b/include/linux/mfd/apalis-tk1-k20.h @@ -22,12 +22,12 @@ #define APALIS_TK1_K20_BULK_WRITE_INST 0x3C #define APALIS_TK1_K20_BULK_READ_INST 0xC3 -#define APALIS_TK1_K20_MAX_BULK (32) +#define APALIS_TK1_K20_MAX_BULK (250) /* General registers*/ #define APALIS_TK1_K20_STAREG 0x00 /* general status register RO */ #define APALIS_TK1_K20_REVREG 0x01 /* FW revision register RO*/ -#define APALIS_TK1_K20_IRQREG 0x02 /* IRQ status RW(write of 1 will reset the bit) */ +#define APALIS_TK1_K20_IRQREG 0x02 /* IRQ status RO(reset of read) */ #define APALIS_TK1_K20_CTRREG 0x03 /* general control register RW */ #define APALIS_TK1_K20_MSQREG 0x04 /* IRQ mask register RW */ @@ -35,21 +35,22 @@ /* CAN Registers */ #define APALIS_TK1_K20_CANREG 0x10 /* CAN0 control & status register RW */ -#define APALIS_TK1_K20_CANERR 0x11 /* CAN0 error register RW */ -#define APALIS_TK1_K20_CAN_BAUD_REG 0x12 /* CAN0 baud set register RW */ -#define APALIS_TK1_K20_CAN_BIT_1 0x13 /* CAN0 bit timing register 1 RW */ -#define APALIS_TK1_K20_CAN_BIT_2 0x14 /* CAN0 bit timing register 2 RW */ -#define APALIS_TK1_K20_CAN_IN_BUF_CNT 0x15 /* CAN0 IN received data count RO */ -#define APALIS_TK1_K20_CAN_IN_BUF 0x16 /* CAN0 IN RO */ +#define APALIS_TK1_K20_CANREG_CLR 0x11 /* CAN0 CANREG clear register WO */ +#define APALIS_TK1_K20_CANERR 0x12 /* CAN0 error register RW */ +#define APALIS_TK1_K20_CAN_BAUD_REG 0x13 /* CAN0 baud set register RW */ +#define APALIS_TK1_K20_CAN_BIT_1 0x14 /* CAN0 bit timing register 1 RW */ +#define APALIS_TK1_K20_CAN_BIT_2 0x15 /* CAN0 bit timing register 2 RW */ +#define APALIS_TK1_K20_CAN_IN_BUF_CNT 0x16 /* CAN0 IN received data count RO */ +#define APALIS_TK1_K20_CAN_IN_BUF 0x17 /* CAN0 IN RO */ /* buffer size is 13 bytes */ -#define APALIS_TK1_K20_CAN_IN_BUF_END 0x22 /* CAN0 IN RO */ -#define APALIS_TK1_K20_CAN_OUT_BUF_CNT 0x23 /* CAN0 OUT data Count WO */ -#define APALIS_TK1_K20_CAN_OUT_BUF 0x26 /* CAN0 OUT WO */ +#define APALIS_TK1_K20_CAN_IN_BUF_END 0x23 /* CAN0 IN RO */ +#define APALIS_TK1_K20_CAN_OUT_BUF 0x24 /* CAN0 OUT WO */ /* buffer size is 13 bytes */ #define APALIS_TK1_K20_CAN_OUT_BUF_END (APALIS_TK1_K20_CAN_OUT_BUF + 13 - 1)/* CAN OUT BUF END */ -#define APALIS_TK1_K20_CAN_DEV_OFFSET(x) (x ? 0x30 : 0) +#define APALIS_TK1_K20_CAN_OFFSET 0x30 +#define APALIS_TK1_K20_CAN_DEV_OFFSET(x) (x ? APALIS_TK1_K20_CAN_OFFSET : 0) -/* 0x33-0x3F Reserved */ +/* 0x30-0x3F Reserved */ /* 0x40-0x62 CAN1 registers same layout as CAN0*/ /* 0x63-0x6F Reserved */ @@ -106,7 +107,7 @@ #define APALIS_TK1_K20_TSC_IRQ 4 #define APALIS_TK1_K20_GPIO_IRQ 5 -#define APALIS_TK1_K20_FW_VER 0x0C +#define APALIS_TK1_K20_FW_VER 0x0D #define FW_MINOR (APALIS_TK1_K20_FW_VER & 0x0F) #define FW_MAJOR ((APALIS_TK1_K20_FW_VER & 0xF0) >> 4) @@ -118,9 +119,15 @@ #define APALIS_TK1_K20_IRQ_REG_CNT 1 #define APALIS_TK1_K20_IRQ_PER_REG 8 -#define APALIS_TK1_CAN_CLK_UNIT 6250 +#define APALIS_TK1_CAN_CLK_UNIT 6250u -#define APALIS_TK1_K20_MAX_SPI_SPEED 12000000 +#define APALIS_TK1_CAN_CLK_UNIT 6250u + +#define APALIS_TK1_MAX_CAN_DMA_XREF 19u + +#define APALIS_TK1_MAX_RETRY_CNT 4 + +#define APALIS_TK1_K20_MAX_SPI_SPEED 6120000 struct apalis_tk1_k20_regmap { struct regmap *regmap; @@ -130,6 +137,8 @@ struct apalis_tk1_k20_regmap { struct regmap_irq irqs[APALIS_TK1_K20_IRQ_REG_CNT * APALIS_TK1_K20_IRQ_PER_REG]; struct regmap_irq_chip irq_chip; struct regmap_irq_chip_data *irq_data; + int can0_irq; + int can1_irq; struct mutex lock; int irq; |