Skip to content

Commit a752ba1

Browse files
Laurent Pinchartgregkh
authored andcommitted
serial: sh-sci: Fix register offsets for the IRDA serial port
Even though most of its registers are 8-bit wide, the IRDA has two 16-bit registers that make it a 16-bit peripheral and not a 8-bit peripheral with addresses shifted by one. Fix the registers offset in the driver and the platform data regshift value. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f48debc commit a752ba1

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

arch/sh/kernel/cpu/sh3/setup-sh770x.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ static struct platform_device scif1_device = {
157157
static struct plat_sci_port scif2_platform_data = {
158158
.type = PORT_IRDA,
159159
.ops = &sh770x_sci_port_ops,
160-
.regshift = 1,
161160
};
162161

163162
static struct resource scif2_resources[] = {

drivers/tty/serial/sh-sci.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,17 @@ static const struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
193193
},
194194

195195
/*
196-
* Common definitions for legacy IrDA ports, dependent on
197-
* regshift value.
196+
* Common definitions for legacy IrDA ports.
198197
*/
199198
[SCIx_IRDA_REGTYPE] = {
200199
[SCSMR] = { 0x00, 8 },
201-
[SCBRR] = { 0x01, 8 },
202-
[SCSCR] = { 0x02, 8 },
203-
[SCxTDR] = { 0x03, 8 },
204-
[SCxSR] = { 0x04, 8 },
205-
[SCxRDR] = { 0x05, 8 },
206-
[SCFCR] = { 0x06, 8 },
207-
[SCFDR] = { 0x07, 16 },
200+
[SCBRR] = { 0x02, 8 },
201+
[SCSCR] = { 0x04, 8 },
202+
[SCxTDR] = { 0x06, 8 },
203+
[SCxSR] = { 0x08, 16 },
204+
[SCxRDR] = { 0x0a, 8 },
205+
[SCFCR] = { 0x0c, 8 },
206+
[SCFDR] = { 0x0e, 16 },
208207
[SCTFDR] = sci_reg_invalid,
209208
[SCRFDR] = sci_reg_invalid,
210209
[SCSPTR] = sci_reg_invalid,

0 commit comments

Comments
 (0)