regmap: mmio: Get rid of broken 64-bit IO
The current implementation, besides having no active users, is broken by design of regmap. For 64-bit IO we need to supply 64-bit value, otherwise there is no way to handle upper 32 bits in 64-bit register. Hence, remove the broken IO accessors for good and wait for real user that can fix entire regmap API for that. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: William Breathitt Gray <william.gray@linaro.org> Link: https://lore.kernel.org/r/20220808203401.35153-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ada79bca38
commit
159dfabd20
@ -32,9 +32,6 @@ static int regmap_mmio_regbits_check(size_t reg_bits)
|
|||||||
case 8:
|
case 8:
|
||||||
case 16:
|
case 16:
|
||||||
case 32:
|
case 32:
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
case 64:
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -56,11 +53,6 @@ static int regmap_mmio_get_min_stride(size_t val_bits)
|
|||||||
case 32:
|
case 32:
|
||||||
min_stride = 4;
|
min_stride = 4;
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
case 64:
|
|
||||||
min_stride = 8;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -124,22 +116,6 @@ static void regmap_mmio_write32be(struct regmap_mmio_context *ctx,
|
|||||||
iowrite32be(val, ctx->regs + reg);
|
iowrite32be(val, ctx->regs + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
static void regmap_mmio_write64le(struct regmap_mmio_context *ctx,
|
|
||||||
unsigned int reg,
|
|
||||||
unsigned int val)
|
|
||||||
{
|
|
||||||
writeq(val, ctx->regs + reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void regmap_mmio_write64le_relaxed(struct regmap_mmio_context *ctx,
|
|
||||||
unsigned int reg,
|
|
||||||
unsigned int val)
|
|
||||||
{
|
|
||||||
writeq_relaxed(val, ctx->regs + reg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int regmap_mmio_write(void *context, unsigned int reg, unsigned int val)
|
static int regmap_mmio_write(void *context, unsigned int reg, unsigned int val)
|
||||||
{
|
{
|
||||||
struct regmap_mmio_context *ctx = context;
|
struct regmap_mmio_context *ctx = context;
|
||||||
@ -207,20 +183,6 @@ static unsigned int regmap_mmio_read32be(struct regmap_mmio_context *ctx,
|
|||||||
return ioread32be(ctx->regs + reg);
|
return ioread32be(ctx->regs + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
static unsigned int regmap_mmio_read64le(struct regmap_mmio_context *ctx,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
return readq(ctx->regs + reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int regmap_mmio_read64le_relaxed(struct regmap_mmio_context *ctx,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
return readq_relaxed(ctx->regs + reg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int regmap_mmio_read(void *context, unsigned int reg, unsigned int *val)
|
static int regmap_mmio_read(void *context, unsigned int reg, unsigned int *val)
|
||||||
{
|
{
|
||||||
struct regmap_mmio_context *ctx = context;
|
struct regmap_mmio_context *ctx = context;
|
||||||
@ -325,17 +287,6 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
|
|||||||
ctx->reg_write = regmap_mmio_write32le;
|
ctx->reg_write = regmap_mmio_write32le;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
case 64:
|
|
||||||
if (config->use_relaxed_mmio) {
|
|
||||||
ctx->reg_read = regmap_mmio_read64le_relaxed;
|
|
||||||
ctx->reg_write = regmap_mmio_write64le_relaxed;
|
|
||||||
} else {
|
|
||||||
ctx->reg_read = regmap_mmio_read64le;
|
|
||||||
ctx->reg_write = regmap_mmio_write64le;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err_free;
|
goto err_free;
|
||||||
|
Loading…
Reference in New Issue
Block a user