Skip to content

Commit 6450c9a

Browse files
Laurent Pinchartgregkh
authored andcommitted
serial: sh-sci: Fix register offsets for the IRDA serial port
[ Upstream commit a752ba18af8285e3eeda572f40dddaebff0c3621 ] 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 <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ca2090a commit 6450c9a

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
@@ -165,7 +165,6 @@ static struct plat_sci_port scif2_platform_data = {
165165
.scscr = SCSCR_TE | SCSCR_RE,
166166
.type = PORT_IRDA,
167167
.ops = &sh770x_sci_port_ops,
168-
.regshift = 1,
169168
};
170169

171170
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
@@ -163,18 +163,17 @@ static const struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
163163
},
164164

165165
/*
166-
* Common definitions for legacy IrDA ports, dependent on
167-
* regshift value.
166+
* Common definitions for legacy IrDA ports.
168167
*/
169168
[SCIx_IRDA_REGTYPE] = {
170169
[SCSMR] = { 0x00, 8 },
171-
[SCBRR] = { 0x01, 8 },
172-
[SCSCR] = { 0x02, 8 },
173-
[SCxTDR] = { 0x03, 8 },
174-
[SCxSR] = { 0x04, 8 },
175-
[SCxRDR] = { 0x05, 8 },
176-
[SCFCR] = { 0x06, 8 },
177-
[SCFDR] = { 0x07, 16 },
170+
[SCBRR] = { 0x02, 8 },
171+
[SCSCR] = { 0x04, 8 },
172+
[SCxTDR] = { 0x06, 8 },
173+
[SCxSR] = { 0x08, 16 },
174+
[SCxRDR] = { 0x0a, 8 },
175+
[SCFCR] = { 0x0c, 8 },
176+
[SCFDR] = { 0x0e, 16 },
178177
[SCTFDR] = sci_reg_invalid,
179178
[SCRFDR] = sci_reg_invalid,
180179
[SCSPTR] = sci_reg_invalid,

0 commit comments

Comments
 (0)