Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/base/power/wakeup_stats.c |
static ssize_t active_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf) {
struct wakeup_source *ws = dev_get_drvdata(dev);
ktime_t active_time = ws->active ? ktime_sub(ktime_get(), ws->last_time) : 0;
return sysfs_emit(buf, "%lld\n", ktime_to_ms(active... | [
0,
0
] |
Linux Kernel | drivers/base/power/wakeup_stats.c |
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct wakeup_source *ws = dev_get_drvdata(dev);
return sysfs_emit(buf, "%s\n", ws->name);
} | [
0,
0
] |
Linux Kernel | drivers/base/power/wakeup_stats.c |
static ssize_t prevent_suspend_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf) {
struct wakeup_source *ws = dev_get_drvdata(dev);
ktime_t prevent_sleep_time = ws->prevent_sleep_time;
if (ws->active... | [
1,
0
] |
Linux Kernel | drivers/base/power/wakeup_stats.c | int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws) {
struct device *dev;
dev = wakeup_source_device_create(parent, ws);
if (IS_ERR(dev))
return PTR_ERR(dev);
ws->dev = dev;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/power/wakeup_stats.c | int pm_wakeup_source_sysfs_add(struct device *parent) {
if (!parent->power.wakeup || parent->power.wakeup->dev)
return 0;
return wakeup_source_sysfs_add(parent, parent->power.wakeup);
} | [
1,
0
] |
Linux Kernel | drivers/base/property.c | bool fwnode_property_present(const struct fwnode_handle *fwnode,
const char *propname) {
bool ret;
if (IS_ERR_OR_NULL(fwnode))
return false;
ret = fwnode_call_bool_op(fwnode, property_present, propname);
if (ret)
return ret;
return fwnode_call_bool_op(fwnode->secondary,... | [
0,
0
] |
Linux Kernel | drivers/base/property.c | int device_property_read_u32_array(struct device *dev, const char *propname,
u32 *val, size_t nval) {
return fwnode_property_read_u32_array(dev_fwnode(dev), propname, val, nval);
} | [
0,
0
] |
Linux Kernel | drivers/base/property.c | struct fwnode_handle *
fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
struct fwnode_handle *child) {
struct fwnode_handle *next_child = child;
if (IS_ERR_OR_NULL(fwnode))
return NULL;
do {
next_child = fwnode_get_next_child_node(fwnode, next... | [
0,
0
] |
Linux Kernel | drivers/base/property.c | struct fwnode_handle *device_get_next_child_node(struct device *dev,
struct fwnode_handle *child) {
const struct fwnode_handle *fwnode = dev_fwnode(dev);
struct fwnode_handle *next;
if (IS_ERR_OR_NULL(fwnode))
return NULL;
next = fwnode_get_next_child_node(... | [
0,
0
] |
Linux Kernel | drivers/base/property.c | struct fwnode_handle *
fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
const char *childname) {
return fwnode_call_ptr_op(fwnode, get_named_child_node, childname);
} | [
0,
0
] |
Linux Kernel | drivers/base/property.c | int fwnode_get_phy_mode(struct fwnode_handle *fwnode) {
const char *pm;
int err, i;
err = fwnode_property_read_string(fwnode, "phy-mode", &pm);
if (err < 0)
err = fwnode_property_read_string(fwnode, "phy-connection-type", &pm);
if (err < 0)
return err;
for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++)
... | [
0,
0
] |
Linux Kernel | drivers/base/property.c | struct fwnode_handle *
fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
struct fwnode_handle *prev) {
const struct fwnode_handle *parent;
struct fwnode_handle *ep;
if (prev)
parent = fwnode_graph_get_port_parent(prev);
else
parent = fwnode;
if (IS_ERR_... | [
0,
0
] |
Linux Kernel | drivers/base/property.c | struct fwnode_handle *
fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode) {
return fwnode_call_ptr_op(fwnode, graph_get_remote_endpoint);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/internal.h | static inline void regmap_debugfs_init(struct regmap *map) {} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/internal.h |
static inline unsigned int regcache_get_index_by_order(const struct regmap *map,
unsigned int reg) {
return reg >> map->reg_stride_order;
}
#endif | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-lzo.c |
static int regcache_lzo_prepare(struct regcache_lzo_ctx *lzo_ctx) {
lzo_ctx->wmem = kmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL);
if (!lzo_ctx->wmem)
return -ENOMEM;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regcache-lzo.c |
static int regcache_lzo_decompress(struct regcache_lzo_ctx *lzo_ctx) {
size_t dst_len;
int ret;
dst_len = lzo_ctx->dst_len;
ret = lzo1x_decompress_safe(lzo_ctx->src, lzo_ctx->src_len, lzo_ctx->dst,
&dst_len);
if (ret != LZO_E_OK || dst_len != lzo_ctx->dst_len)
return -EINVA... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-lzo.c | static int regcache_lzo_write(struct regmap *map, unsigned int reg,
unsigned int value) {
struct regcache_lzo_ctx *lzo_block, **lzo_blocks;
int ret, blkindex, blkpos;
size_t tmp_dst_len;
void *tmp_dst;
blkindex = regcache_lzo_get_blkindex(map, reg);
/* register index within th... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-lzo.c | static int regcache_lzo_sync(struct regmap *map, unsigned int min,
unsigned int max) {
struct regcache_lzo_ctx **lzo_blocks;
unsigned int val;
int i;
int ret;
lzo_blocks = map->cache;
i = min;
for_each_set_bit_from(i, lzo_blocks[0]->sync_bmp,
lzo_block... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c |
static inline void
regcache_rbtree_get_base_top_reg(struct regmap *map,
struct regcache_rbtree_node *rbnode,
unsigned int *base, unsigned int *top) {
*base = rbnode->base_reg;
*top = rbnode->base_reg + ((rbnode->blklen - 1) * map->reg_stride);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c |
static unsigned int regcache_rbtree_get_register(
struct regmap *map, struct regcache_rbtree_node *rbnode, unsigned int idx) {
return regcache_get_val(map, rbnode->block, idx);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c | static int rbtree_show(struct seq_file *s, void *ignored) {
struct regmap *map = s->private;
struct regcache_rbtree_ctx *rbtree_ctx = map->cache;
struct regcache_rbtree_node *n;
struct rb_node *node;
unsigned int base, top;
size_t mem_size;
int nodes = 0;
int registers = 0;
int this_registers, average... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c | static int regcache_rbtree_exit(struct regmap *map) {
struct rb_node *next;
struct regcache_rbtree_ctx *rbtree_ctx;
struct regcache_rbtree_node *rbtree_node;
rbtree_ctx = map->cache;
if (!rbtree_ctx)
return 0;
/* free up the rbtree */
next = rb_first(&rbtree_ctx->root);
while (next) {
rbtree_n... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c | static struct regcache_rbtree_node *
regcache_rbtree_node_alloc(struct regmap *map, unsigned int reg) {
struct regcache_rbtree_node *rbnode;
const struct regmap_range *range;
int i;
rbnode = kzalloc(sizeof(*rbnode), GFP_KERNEL);
if (!rbnode)
return NULL;
if (map->rd_table) {
for (i = 0; i < map->r... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache-rbtree.c |
static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
unsigned int max) {
struct regcache_rbtree_ctx *rbtree_ctx;
struct rb_node *node;
struct regcache_rbtree_node *rbnode;
unsigned int base_reg, top_reg;
unsigned int start, end;
int ret;
rbtree_ctx = map-... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache.c | int regcache_sync_region(struct regmap *map, unsigned int min,
unsigned int max) {
int ret = 0;
const char *name;
bool bypass;
BUG_ON(!map->cache_ops);
map->lock(map->lock_arg);
bypass = map->cache_bypass;
name = map->cache_ops->name;
dev_dbg(map->dev, "Syncing %s cache from... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache.c | void regcache_cache_only(struct regmap *map, bool enable) {
map->lock(map->lock_arg);
WARN_ON(map->cache_type != REGCACHE_NONE && map->cache_bypass && enable);
map->cache_only = enable;
trace_regmap_cache_only(map, enable);
map->unlock(map->lock_arg);
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regcache.c | bool regcache_set_val(struct regmap *map, void *base, unsigned int idx,
unsigned int val) {
if (regcache_get_val(map, base, idx) == val)
return true;
if (map->format.format_val) {
map->format.format_val(base + (map->cache_word_size * idx), val, 0);
return false;
}
switch (map... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-debugfs.c |
static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) {
struct regmap *map = file->private_data;
return regmap_read_debugfs(map, 0, map->max_register, user_buf, count, ppos);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-debugfs.c | static ssize_t regmap_map_write_file(struct file *file,
const char __user *user_buf, size_t count,
loff_t *ppos) {
char buf[32];
size_t buf_size;
char *start = buf;
unsigned long reg, value;
struct regmap *map = file->private_data;
in... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-debugfs.c | static ssize_t regmap_reg_ranges_read_file(struct file *file,
char __user *user_buf, size_t count,
loff_t *ppos) {
struct regmap *map = file->private_data;
struct regmap_debugfs_off_cache *c;
loff_t p = 0;
size_t buf_pos = 0;
... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-debugfs.c | static ssize_t regmap_cache_only_write_file(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos) {
struct regmap *map =
container_of(file->private_data, struct regmap, cache_only);
bool new_val, requ... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
static int regmap_fsi32_reg_read(void *context, unsigned int reg,
unsigned int *val) {
u32 v;
int ret;
ret = fsi_slave_read(context, reg, &v, sizeof(v));
if (ret)
return ret;
*val = v;
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
static int regmap_fsi32le_reg_write(void *context, unsigned int reg,
unsigned int val) {
__be32 v = cpu_to_be32(val);
return fsi_slave_write(context, reg, &v, sizeof(v));
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
static int regmap_fsi16_reg_read(void *context, unsigned int reg,
unsigned int *val) {
u16 v;
int ret;
ret = fsi_slave_read(context, reg, &v, sizeof(v));
if (ret)
return ret;
*val = v;
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
static int regmap_fsi16_reg_write(void *context, unsigned int reg,
unsigned int val) {
u16 v;
if (val > 0xffff)
return -EINVAL;
v = val;
return fsi_slave_write(context, reg, &v, sizeof(v));
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
static const struct regmap_bus *
regmap_get_fsi_bus(struct fsi_device *fsi_dev,
const struct regmap_config *config) {
const struct regmap_bus *bus = NULL;
if (config->reg_bits == 8 || config->reg_bits == 16 ||
config->reg_bits == 32) {
switch (config->val_bits) {
case 8:
bus... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-fsi.c |
struct regmap *__devm_regmap_init_fsi(struct fsi_device *fsi_dev,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name) {
const struct regmap_bus *bus = regmap_get_f... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-i2c.c |
static int regmap_smbus_byte_reg_read(void *context, unsigned int reg,
unsigned int *val) {
struct device *dev = context;
struct i2c_client *i2c = to_i2c_client(dev);
int ret;
if (reg > 0xff)
return -EINVAL;
ret = i2c_smbus_read_byte_data(i2c, reg);
if (ret < 0)
... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-i3c.c |
static int regmap_i3c_write(void *context, const void *data, size_t count) {
struct device *dev = context;
struct i3c_device *i3c = dev_to_i3cdev(dev);
struct i3c_priv_xfer xfers[] = {
{
.rnw = false,
.len = count,
.data.out = data,
},
};
return i3c_device_do_priv_x... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-i3c.c |
struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name) {
return __devm_regmap_init(&i3c->dev, ®map_i3... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c |
static inline const struct regmap_irq *
irq_to_regmap_irq(struct regmap_irq_chip_data *data, int irq) {
return &data->chip->irqs[irq];
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c | static bool regmap_irq_can_bulk_read_status(struct regmap_irq_chip_data *data) {
struct regmap *map = data->map;
return data->irq_reg_stride == 1 && map->reg_stride == 1 &&
data->get_irq_reg == regmap_irq_get_irq_reg_linear &&
!map->use_single_read;
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c |
static void regmap_irq_disable(struct irq_data *data) {
struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
struct regmap *map = d->map;
const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
d->mask_buf[irq_data->reg_offset / map->reg_stride] |= irq_data->mask;
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c |
static int regmap_irq_set_wake(struct irq_data *data, unsigned int on) {
struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
struct regmap *map = d->map;
const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
if (on) {
if (d->wake_buf)
d->wake_buf[irq_data->reg_offset ... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c | static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
unsigned int b) {
const struct regmap_irq_chip *chip = data->chip;
struct regmap *map = data->map;
struct regmap_irq_sub_irq_map *subreg;
unsigned int reg;
int i, ret = 0;
if (!chip->sub_reg_offsets) ... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c | unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
unsigned int base, int index) {
const struct regmap_irq_chip *chip = data->chip;
struct regmap *map = data->map;
/*
* FIXME: This is for backward compatibility and should be removed
* wh... | [
1,
1
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c | int devm_regmap_add_irq_chip_fwnode(struct device *dev,
struct fwnode_handle *fwnode,
struct regmap *map, int irq, int irq_flags,
int irq_base,
const struct regmap_irq_chip *ch... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-irq.c | void devm_regmap_del_irq_chip(struct device *dev, int irq,
struct regmap_irq_chip_data *data) {
int rc;
WARN_ON(irq != data->irq);
rc = devres_release(dev, devm_regmap_irq_chip_release,
devm_regmap_irq_chip_match, data);
if (rc != 0)
WARN_ON(rc);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mdio.c |
static int regmap_mdio_read(struct mdio_device *mdio_dev, u32 reg,
unsigned int *val) {
int ret;
ret = mdiodev_read(mdio_dev, reg);
if (ret < 0)
return ret;
*val = ret & REGVAL_MASK;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mdio.c |
static int regmap_mdio_write(struct mdio_device *mdio_dev, u32 reg,
unsigned int val) {
return mdiodev_write(mdio_dev, reg, val);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mdio.c |
struct regmap *__devm_regmap_init_mdio(struct mdio_device *mdio_dev,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name) {
const struct regmap_bus *bus;
if (... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mmio.c | static int regmap_mmio_get_min_stride(size_t val_bits) {
int min_stride;
switch (val_bits) {
case 8:
min_stride = 0;
break;
case 16:
min_stride = 2;
break;
case 32:
min_stride = 4;
break;
default:
return -EINVAL;
}
return min_stride;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mmio.c |
static int regmap_mmio_write(void *context, unsigned int reg,
unsigned int val) {
struct regmap_mmio_context *ctx = context;
int ret;
if (!IS_ERR(ctx->clk)) {
ret = clk_enable(ctx->clk);
if (ret < 0)
return ret;
}
ctx->reg_write(ctx, reg, val);
if (!IS_ERR(ctx-... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mmio.c |
static unsigned int regmap_mmio_read16le(struct regmap_mmio_context *ctx,
unsigned int reg) {
return readw(ctx->regs + reg);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mmio.c | static int regmap_mmio_noinc_read(void *context, unsigned int reg, void *val,
size_t val_count) {
struct regmap_mmio_context *ctx = context;
int ret = 0;
if (!IS_ERR(ctx->clk)) {
ret = clk_enable(ctx->clk);
if (ret < 0)
return ret;
}
switch (ctx->val_bytes) {
... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-mmio.c |
int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk) {
struct regmap_mmio_context *ctx = map->bus_context;
ctx->clk = clk;
ctx->attached_clk = true;
return clk_prepare(ctx->clk);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-sccb.c | static int regmap_sccb_write(void *context, unsigned int reg,
unsigned int val) {
struct device *dev = context;
struct i2c_client *i2c = to_i2c_client(dev);
return i2c_smbus_write_byte_data(i2c, reg, val);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-sdw.c |
static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val) {
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
return sdw_write_no_pm(slave, reg, val);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-sdw.c |
static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val) {
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
int read;
read = sdw_read_no_pm(slave, reg);
if (read < 0)
return read;
*val = read;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-slimbus.c |
static int regmap_slimbus_write(void *context, const void *data, size_t count) {
struct slim_device *sdev = context;
return slim_write(sdev, *(u16 *)data, count - 2, (u8 *)data + 2);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-slimbus.c |
static int regmap_slimbus_read(void *context, const void *reg, size_t reg_size,
void *val, size_t val_size) {
struct slim_device *sdev = context;
return slim_read(sdev, *(u16 *)reg, val_size, val);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-slimbus.c |
struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name) {
const struct regmap_bus *b... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-spi-avmm.c | static int do_reg_access(void *context, bool is_read, unsigned int reg,
unsigned int *value, unsigned int count) {
struct spi_avmm_bridge *br = context;
int ret;
br->trans_len = 0;
br->phy_len = 0;
ret = br_trans_tx_prepare(br, is_read, reg, value, count);
if (ret)
return ret;... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-spi-avmm.c |
static int regmap_spi_avmm_write(void *context, const void *data,
size_t bytes) {
if (bytes < SPI_AVMM_REG_SIZE + SPI_AVMM_VAL_SIZE)
return -EINVAL;
return regmap_spi_avmm_gather_write(context, data, SPI_AVMM_REG_SIZE,
data + SPI_AVMM_REG_... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-spi-avmm.c | static struct spi_avmm_bridge *spi_avmm_bridge_ctx_gen(struct spi_device *spi) {
struct spi_avmm_bridge *br;
if (!spi)
return ERR_PTR(-ENODEV);
spi->mode = SPI_MODE_1;
spi->bits_per_word = 32;
if (spi_setup(spi)) {
spi->bits_per_word = 8;
if (spi_setup(spi))
return ERR_PTR(-EINVAL);
}
... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap-spmi.c | static int regmap_spmi_ext_read(void *context, const void *reg, size_t reg_size,
void *val, size_t val_size) {
int err = 0;
size_t len;
u16 addr;
BUG_ON(reg_size != 2);
addr = *(u16 *)reg;
while (addr <= 0xFF && val_size) {
len = min_t(size_t, val_size, 16);
err =... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap-w1.c | static int w1_reg_a8_v16_read(void *context, unsigned int reg,
unsigned int *val) {
struct device *dev = context;
struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
int ret = 0;
if (reg > 255)
return -EINVAL;
mutex_lock(&sl->master->bus_mutex);
if (!w1_reset_s... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | bool regmap_check_range_table(struct regmap *map, unsigned int reg,
const struct regmap_access_table *table) {
if (regmap_reg_in_ranges(reg, table->no_ranges, table->n_no_ranges))
return false;
/* In case zero "yes ranges" are supplied, any reg is OK */
if (!table->n_yes_ranges... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
bool regmap_writeable_noinc(struct regmap *map, unsigned int reg) {
if (map->writeable_noinc_reg)
return map->writeable_noinc_reg(map->dev, reg);
if (map->wr_noinc_table)
return regmap_check_range_table(map, reg, map->wr_noinc_table);
return true;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
bool regmap_readable_noinc(struct regmap *map, unsigned int reg) {
if (map->readable_noinc_reg)
return map->readable_noinc_reg(map->dev, reg);
if (map->rd_noinc_table)
return regmap_check_range_table(map, reg, map->rd_noinc_table);
return true;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_format_2_6_write(struct regmap *map, unsigned int reg,
unsigned int val) {
u8 *out = map->work_buf;
*out = (reg << 6) | val;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_format_4_12_write(struct regmap *map, unsigned int reg,
unsigned int val) {
__be16 *out = map->work_buf;
*out = cpu_to_be16((reg << 12) | val);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_format_10_14_write(struct regmap *map, unsigned int reg,
unsigned int val) {
u8 *out = map->work_buf;
out[2] = val;
out[1] = (val >> 8) | (reg << 6);
out[0] = reg >> 2;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | static void regmap_format_64_be(void *buf, unsigned int val,
unsigned int shift) {
put_unaligned_be64((u64)val << shift, buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_format_64_le(void *buf, unsigned int val,
unsigned int shift) {
put_unaligned_le64((u64)val << shift, buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_parse_inplace_noop(void *buf) {} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static unsigned int regmap_parse_16_le(const void *buf) {
return get_unaligned_le16(buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_parse_16_be_inplace(void *buf) {
u16 v = get_unaligned_be16(buf);
memcpy(buf, &v, sizeof(v));
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_parse_16_le_inplace(void *buf) {
u16 v = get_unaligned_le16(buf);
memcpy(buf, &v, sizeof(v));
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static unsigned int regmap_parse_24_be(const void *buf) {
return get_unaligned_be24(buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | static unsigned int regmap_parse_64_be(const void *buf) {
return get_unaligned_be64(buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static unsigned int regmap_parse_64_le(const void *buf) {
return get_unaligned_le64(buf);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_lock_hwlock(void *__map) {
struct regmap *map = __map;
hwspin_lock_timeout(map->hwlock, UINT_MAX);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_unlock_hwlock(void *__map) {
struct regmap *map = __map;
hwspin_unlock(map->hwlock);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_unlock_hwlock_irq(void *__map) {
struct regmap *map = __map;
hwspin_unlock_irq(map->hwlock);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_unlock_mutex(void *__map) {
struct regmap *map = __map;
mutex_unlock(&map->mutex);
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_unlock_raw_spinlock(void *__map)
__releases(&map->raw_spinlock | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | static void dev_get_regmap_release(struct device *dev, void *res) {} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static bool _regmap_range_add(struct regmap *map,
struct regmap_range_node *data) {
struct rb_root *root = &map->range_tree;
struct rb_node **new = &(root->rb_node), *parent = NULL;
while (*new) {
struct regmap_range_node *this =
rb_entry(*new, struct regmap_range_node,... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static struct regmap_range_node *_regmap_range_lookup(struct regmap *map,
unsigned int reg) {
struct rb_node *node = map->range_tree.rb_node;
while (node) {
struct regmap_range_node *this =
rb_entry(node, struct regmap_range_node, node);
if (r... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_range_exit(struct regmap *map) {
struct rb_node *next;
struct regmap_range_node *range_node;
next = rb_first(&map->range_tree);
while (next) {
range_node = rb_entry(next, struct regmap_range_node, node);
next = rb_next(&range_node->node);
rb_erase(&range_node->node, &map->range_... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
struct regmap *
__devm_regmap_init(struct device *dev, const struct regmap_bus *bus,
void *bus_context, const struct regmap_config *config,
struct lock_class_key *lock_key, const char *lock_name) {
struct regmap **ptr, *regmap;
ptr = devres_alloc(devm_regmap_release, sizeof(*... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | void regmap_exit(struct regmap *map) {
struct regmap_async *async;
regcache_exit(map);
regmap_debugfs_exit(map);
regmap_range_exit(map);
if (map->bus && map->bus->free_context)
map->bus->free_context(map->bus_context);
kfree(map->work_buf);
while (!list_empty(&map->async_free)) {
async =
... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | static int dev_get_regmap_match(struct device *dev, void *res, void *data) {
struct regmap **r = res;
if (!r || !*r) {
WARN_ON(!r || !*r);
return 0;
}
if (data)
return !strcmp((*r)->name, data);
else
return 1;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | struct device *regmap_get_device(struct regmap *map) { return map->dev; } | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static void regmap_set_work_buf_flag_mask(struct regmap *map, int max_bytes,
unsigned long mask) {
u8 *buf;
int i;
if (!mask || !map->work_buf)
return;
buf = map->work_buf;
for (i = 0; i < max_bytes; i++)
buf[i] |= (mask >> (8 * i)) & 0xff;
} | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | size_t regmap_get_raw_write_max(struct regmap *map) {
return map->max_raw_write;
} | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static int _regmap_bus_formatted_write(void *context, unsigned int reg,
unsigned int val) {
int ret;
struct regmap_range_node *range;
struct regmap *map = context;
WARN_ON(!map->format.format_write);
range = _regmap_range_lookup(map, reg);
if (range) {
ret = _re... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val,
size_t val_len) {
int ret;
if (!regmap_can_raw_write(map))
return -EINVAL;
if (val_len % map->format.val_bytes)
return -EINVAL;
map->lock(map->lock_arg);
ret = _regmap_raw_write(map, reg, val, val_len, ... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.