Lines Matching refs:ocelot

13 int __ocelot_bulk_read_ix(struct ocelot *ocelot, u32 reg, u32 offset, void *buf,  in __ocelot_bulk_read_ix()  argument
20 return regmap_bulk_read(ocelot->targets[target], in __ocelot_bulk_read_ix()
21 ocelot->map[target][reg & REG_MASK] + offset, in __ocelot_bulk_read_ix()
26 u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) in __ocelot_read_ix() argument
33 regmap_read(ocelot->targets[target], in __ocelot_read_ix()
34 ocelot->map[target][reg & REG_MASK] + offset, &val); in __ocelot_read_ix()
39 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) in __ocelot_write_ix() argument
45 regmap_write(ocelot->targets[target], in __ocelot_write_ix()
46 ocelot->map[target][reg & REG_MASK] + offset, val); in __ocelot_write_ix()
50 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, in __ocelot_rmw_ix() argument
57 regmap_update_bits(ocelot->targets[target], in __ocelot_rmw_ix()
58 ocelot->map[target][reg & REG_MASK] + offset, in __ocelot_rmw_ix()
65 struct ocelot *ocelot = port->ocelot; in ocelot_port_readl() local
71 regmap_read(port->target, ocelot->map[target][reg & REG_MASK], &val); in ocelot_port_readl()
78 struct ocelot *ocelot = port->ocelot; in ocelot_port_writel() local
83 regmap_write(port->target, ocelot->map[target][reg & REG_MASK], val); in ocelot_port_writel()
95 u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target, in __ocelot_target_read_ix() argument
100 regmap_read(ocelot->targets[target], in __ocelot_target_read_ix()
101 ocelot->map[target][reg] + offset, &val); in __ocelot_target_read_ix()
105 void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target, in __ocelot_target_write_ix() argument
108 regmap_write(ocelot->targets[target], in __ocelot_target_write_ix()
109 ocelot->map[target][reg] + offset, val); in __ocelot_target_write_ix()
112 int ocelot_regfields_init(struct ocelot *ocelot, in ocelot_regfields_init() argument
127 regfield.reg = ocelot->map[target][reg & REG_MASK]; in ocelot_regfields_init()
133 ocelot->regfields[i] = in ocelot_regfields_init()
134 devm_regmap_field_alloc(ocelot->dev, in ocelot_regfields_init()
135 ocelot->targets[target], in ocelot_regfields_init()
138 if (IS_ERR(ocelot->regfields[i])) in ocelot_regfields_init()
139 return PTR_ERR(ocelot->regfields[i]); in ocelot_regfields_init()
152 struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res) in ocelot_regmap_init() argument
156 regs = devm_ioremap_resource(ocelot->dev, res); in ocelot_regmap_init()
162 return devm_regmap_init_mmio(ocelot->dev, regs, &ocelot_regmap_config); in ocelot_regmap_init()