• Home
  • Raw
  • Download

Lines Matching refs:reg

66 static int regmap_encx24j600_sfr_read(void *context, u8 reg, u8 *val,  in regmap_encx24j600_sfr_read()  argument
70 u8 banked_reg = reg & ADDR_MASK; in regmap_encx24j600_sfr_read()
71 u8 bank = ((reg & BANK_MASK) >> BANK_SHIFT); in regmap_encx24j600_sfr_read()
77 if (reg < 0x80) { in regmap_encx24j600_sfr_read()
87 switch (reg) { in regmap_encx24j600_sfr_read()
110 tx_buf[i++] = reg; in regmap_encx24j600_sfr_read()
118 u8 reg, u8 *val, size_t len, in regmap_encx24j600_sfr_update() argument
121 u8 banked_reg = reg & ADDR_MASK; in regmap_encx24j600_sfr_update()
122 u8 bank = ((reg & BANK_MASK) >> BANK_SHIFT); in regmap_encx24j600_sfr_update()
126 { .tx_buf = &reg, .len = sizeof(reg), }, in regmap_encx24j600_sfr_update()
129 if (reg < 0x80) { in regmap_encx24j600_sfr_update()
140 switch (reg) { in regmap_encx24j600_sfr_update()
165 t[1].tx_buf = &reg; in regmap_encx24j600_sfr_update()
173 static int regmap_encx24j600_sfr_write(void *context, u8 reg, u8 *val, in regmap_encx24j600_sfr_write() argument
177 return regmap_encx24j600_sfr_update(ctx, reg, val, len, WCRU, WCRCODE); in regmap_encx24j600_sfr_write()
181 u8 reg, u8 val) in regmap_encx24j600_sfr_set_bits() argument
183 return regmap_encx24j600_sfr_update(ctx, reg, &val, 1, BFSU, BFSCODE); in regmap_encx24j600_sfr_set_bits()
187 u8 reg, u8 val) in regmap_encx24j600_sfr_clr_bits() argument
189 return regmap_encx24j600_sfr_update(ctx, reg, &val, 1, BFCU, BFCCODE); in regmap_encx24j600_sfr_clr_bits()
192 static int regmap_encx24j600_reg_update_bits(void *context, unsigned int reg, in regmap_encx24j600_reg_update_bits() argument
202 if ((reg >= 0x40 && reg < 0x6c) || reg >= 0x80) in regmap_encx24j600_reg_update_bits()
206 ret = regmap_encx24j600_sfr_set_bits(ctx, reg, set_mask); in regmap_encx24j600_reg_update_bits()
211 ret = regmap_encx24j600_sfr_set_bits(ctx, reg + 1, set_mask); in regmap_encx24j600_reg_update_bits()
214 ret = regmap_encx24j600_sfr_clr_bits(ctx, reg, clr_mask); in regmap_encx24j600_reg_update_bits()
219 ret = regmap_encx24j600_sfr_clr_bits(ctx, reg + 1, clr_mask); in regmap_encx24j600_reg_update_bits()
224 int regmap_encx24j600_spi_write(void *context, u8 reg, const u8 *data, in regmap_encx24j600_spi_write() argument
229 if (reg < 0xc0) in regmap_encx24j600_spi_write()
230 return encx24j600_cmdn(ctx, reg, data, count); in regmap_encx24j600_spi_write()
233 return spi_write(ctx->spi, &reg, 1); in regmap_encx24j600_spi_write()
237 int regmap_encx24j600_spi_read(void *context, u8 reg, u8 *data, size_t count) in regmap_encx24j600_spi_read() argument
241 if (reg == RBSEL && count > 1) in regmap_encx24j600_spi_read()
244 return spi_write_then_read(ctx->spi, &reg, sizeof(reg), data, count); in regmap_encx24j600_spi_read()
252 u8 reg = dout[0]; in regmap_encx24j600_write() local
256 if (reg > 0xa0) in regmap_encx24j600_write()
257 return regmap_encx24j600_spi_write(context, reg, dout, len); in regmap_encx24j600_write()
262 return regmap_encx24j600_sfr_write(context, reg, dout, len); in regmap_encx24j600_write()
269 u8 reg = *(const u8 *)reg_buf; in regmap_encx24j600_read() local
272 pr_err("%s: reg=%02x reg_size=%zu\n", __func__, reg, reg_size); in regmap_encx24j600_read()
276 if (reg > 0xa0) in regmap_encx24j600_read()
277 return regmap_encx24j600_spi_read(context, reg, val, val_size); in regmap_encx24j600_read()
280 pr_err("%s: reg=%02x val_size=%zu\n", __func__, reg, val_size); in regmap_encx24j600_read()
284 return regmap_encx24j600_sfr_read(context, reg, val, val_size); in regmap_encx24j600_read()
287 static bool encx24j600_regmap_readable(struct device *dev, unsigned int reg) in encx24j600_regmap_readable() argument
289 if ((reg < 0x36) || in encx24j600_regmap_readable()
290 ((reg >= 0x40) && (reg < 0x4c)) || in encx24j600_regmap_readable()
291 ((reg >= 0x52) && (reg < 0x56)) || in encx24j600_regmap_readable()
292 ((reg >= 0x60) && (reg < 0x66)) || in encx24j600_regmap_readable()
293 ((reg >= 0x68) && (reg < 0x80)) || in encx24j600_regmap_readable()
294 ((reg >= 0x86) && (reg < 0x92)) || in encx24j600_regmap_readable()
295 (reg == 0xc8)) in encx24j600_regmap_readable()
301 static bool encx24j600_regmap_writeable(struct device *dev, unsigned int reg) in encx24j600_regmap_writeable() argument
303 if ((reg < 0x12) || in encx24j600_regmap_writeable()
304 ((reg >= 0x14) && (reg < 0x1a)) || in encx24j600_regmap_writeable()
305 ((reg >= 0x1c) && (reg < 0x36)) || in encx24j600_regmap_writeable()
306 ((reg >= 0x40) && (reg < 0x4c)) || in encx24j600_regmap_writeable()
307 ((reg >= 0x52) && (reg < 0x56)) || in encx24j600_regmap_writeable()
308 ((reg >= 0x60) && (reg < 0x68)) || in encx24j600_regmap_writeable()
309 ((reg >= 0x6c) && (reg < 0x80)) || in encx24j600_regmap_writeable()
310 ((reg >= 0x86) && (reg < 0x92)) || in encx24j600_regmap_writeable()
311 ((reg >= 0xc0) && (reg < 0xc8)) || in encx24j600_regmap_writeable()
312 ((reg >= 0xca) && (reg < 0xf0))) in encx24j600_regmap_writeable()
318 static bool encx24j600_regmap_volatile(struct device *dev, unsigned int reg) in encx24j600_regmap_volatile() argument
320 switch (reg) { in encx24j600_regmap_volatile()
339 static bool encx24j600_regmap_precious(struct device *dev, unsigned int reg) in encx24j600_regmap_precious() argument
342 if (((reg >= 0xc0) && (reg < 0xc8)) || in encx24j600_regmap_precious()
343 ((reg >= 0xca) && (reg < 0xf0))) in encx24j600_regmap_precious()
349 static int regmap_encx24j600_phy_reg_read(void *context, unsigned int reg, in regmap_encx24j600_phy_reg_read() argument
356 reg = MIREGADR_VAL | (reg & PHREG_MASK); in regmap_encx24j600_phy_reg_read()
357 ret = regmap_write(ctx->regmap, MIREGADR, reg); in regmap_encx24j600_phy_reg_read()
382 reg & PHREG_MASK); in regmap_encx24j600_phy_reg_read()
387 static int regmap_encx24j600_phy_reg_write(void *context, unsigned int reg, in regmap_encx24j600_phy_reg_write() argument
394 reg = MIREGADR_VAL | (reg & PHREG_MASK); in regmap_encx24j600_phy_reg_write()
395 ret = regmap_write(ctx->regmap, MIREGADR, reg); in regmap_encx24j600_phy_reg_write()
411 reg & PHREG_MASK, val); in regmap_encx24j600_phy_reg_write()
416 static bool encx24j600_phymap_readable(struct device *dev, unsigned int reg) in encx24j600_phymap_readable() argument
418 switch (reg) { in encx24j600_phymap_readable()
433 static bool encx24j600_phymap_writeable(struct device *dev, unsigned int reg) in encx24j600_phymap_writeable() argument
435 switch (reg) { in encx24j600_phymap_writeable()
450 static bool encx24j600_phymap_volatile(struct device *dev, unsigned int reg) in encx24j600_phymap_volatile() argument
452 switch (reg) { in encx24j600_phymap_volatile()