Unverified Commit 1b2de997 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5286 serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO

parents 28153fcb 8226f9fd
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -375,9 +375,7 @@ static void sc16is7xx_fifo_read(struct uart_port *port, unsigned int rxlen)
	const u8 line = sc16is7xx_line(port);
	u8 addr = (SC16IS7XX_RHR_REG << SC16IS7XX_REG_SHIFT) | line;

	regcache_cache_bypass(s->regmap, true);
	regmap_raw_read(s->regmap, addr, s->buf, rxlen);
	regcache_cache_bypass(s->regmap, false);
	regmap_noinc_read(s->regmap, addr, s->buf, rxlen);
}

static void sc16is7xx_fifo_write(struct uart_port *port, u8 to_send)
@@ -393,9 +391,7 @@ static void sc16is7xx_fifo_write(struct uart_port *port, u8 to_send)
	if (unlikely(!to_send))
		return;

	regcache_cache_bypass(s->regmap, true);
	regmap_raw_write(s->regmap, addr, s->buf, to_send);
	regcache_cache_bypass(s->regmap, false);
	regmap_noinc_write(s->regmap, addr, s->buf, to_send);
}

static void sc16is7xx_port_update(struct uart_port *port, u8 reg,
@@ -488,6 +484,11 @@ static bool sc16is7xx_regmap_precious(struct device *dev, unsigned int reg)
	return false;
}

static bool sc16is7xx_regmap_noinc(struct device *dev, unsigned int reg)
{
	return reg == SC16IS7XX_RHR_REG;
}

static int sc16is7xx_set_baud(struct uart_port *port, int baud)
{
	struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
@@ -1426,6 +1427,8 @@ static struct regmap_config regcfg = {
	.cache_type = REGCACHE_RBTREE,
	.volatile_reg = sc16is7xx_regmap_volatile,
	.precious_reg = sc16is7xx_regmap_precious,
	.writeable_noinc_reg = sc16is7xx_regmap_noinc,
	.readable_noinc_reg = sc16is7xx_regmap_noinc,
};

#ifdef CONFIG_SERIAL_SC16IS7XX_SPI