Lines Matching full:ocelot
3 * Microsemi Ocelot Switch driver
11 #include "ocelot.h"
13 u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) in __ocelot_read_ix() argument
20 regmap_read(ocelot->targets[target], in __ocelot_read_ix()
21 ocelot->map[target][reg & REG_MASK] + offset, &val); in __ocelot_read_ix()
26 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) in __ocelot_write_ix() argument
32 regmap_write(ocelot->targets[target], in __ocelot_write_ix()
33 ocelot->map[target][reg & REG_MASK] + offset, val); in __ocelot_write_ix()
37 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, in __ocelot_rmw_ix() argument
44 regmap_update_bits(ocelot->targets[target], in __ocelot_rmw_ix()
45 ocelot->map[target][reg & REG_MASK] + offset, in __ocelot_rmw_ix()
52 struct ocelot *ocelot = port->ocelot; in ocelot_port_readl() local
58 regmap_read(port->target, ocelot->map[target][reg & REG_MASK], &val); in ocelot_port_readl()
65 struct ocelot *ocelot = port->ocelot; in ocelot_port_writel() local
70 regmap_write(port->target, ocelot->map[target][reg & REG_MASK], val); in ocelot_port_writel()
74 u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target, in __ocelot_target_read_ix() argument
79 regmap_read(ocelot->targets[target], in __ocelot_target_read_ix()
80 ocelot->map[target][reg] + offset, &val); in __ocelot_target_read_ix()
84 void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target, in __ocelot_target_write_ix() argument
87 regmap_write(ocelot->targets[target], in __ocelot_target_write_ix()
88 ocelot->map[target][reg] + offset, val); in __ocelot_target_write_ix()
91 int ocelot_regfields_init(struct ocelot *ocelot, in ocelot_regfields_init() argument
106 regfield.reg = ocelot->map[target][reg & REG_MASK]; in ocelot_regfields_init()
112 ocelot->regfields[i] = in ocelot_regfields_init()
113 devm_regmap_field_alloc(ocelot->dev, in ocelot_regfields_init()
114 ocelot->targets[target], in ocelot_regfields_init()
117 if (IS_ERR(ocelot->regfields[i])) in ocelot_regfields_init()
118 return PTR_ERR(ocelot->regfields[i]); in ocelot_regfields_init()
131 struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res) in ocelot_regmap_init() argument
135 regs = devm_ioremap_resource(ocelot->dev, res); in ocelot_regmap_init()
141 return devm_regmap_init_mmio(ocelot->dev, regs, &ocelot_regmap_config); in ocelot_regmap_init()