Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_noinc_write(struct regmap *map, unsigned int reg, const void *val,
size_t val_len) {
size_t write_len;
int ret;
if (!map->write && !(map->bus && map->bus->reg_noinc_write))
return -EINVAL;
if (val_len % map->format.val_bytes)
return -EINVAL;
if (!IS_ALIGNED(reg, map-... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_raw_write_async(struct regmap *map, unsigned int reg,
const void *val, size_t val_len) {
int ret;
if (val_len % map->format.val_bytes)
return -EINVAL;
if (!IS_ALIGNED(reg, map->reg_stride))
return -EINVAL;
map->lock(map->lock_arg);
map->async = true;
ret = _... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
unsigned int val_len, bool noinc) {
struct regmap_range_node *range;
int ret;
if (!map->read)
return -EINVAL;
range = _regmap_range_lookup(map, reg);
if (range) {
ret = _regmap_select_page(map, ... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c |
static int _regmap_read(struct regmap *map, unsigned int reg,
unsigned int *val) {
int ret;
void *context = _regmap_map_get_context(map);
if (!map->cache_bypass) {
ret = regcache_read(map, reg, val);
if (ret == 0)
return 0;
}
if (map->cache_only)
return -EBUSY;
... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
size_t val_count) {
int ret, i;
size_t val_bytes = map->format.val_bytes;
bool vol = regmap_volatile_range(map, reg, val_count);
if (!IS_ALIGNED(reg, map->reg_stride))
return -EINVAL;
if (val_count == 0)
return... | [
1,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_update_bits_base(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val, bool *change,
bool async, bool force) {
int ret;
map->lock(map->lock_arg);
map->async = async;
ret = _regmap_update_bits(map, reg, mask, val, change, ... | [
0,
0
] |
Linux Kernel | drivers/base/regmap/regmap.c | int regmap_get_max_register(struct regmap *map) {
return map->max_register ? map->max_register : -EINVAL;
} | [
1,
0
] |
Linux Kernel | drivers/base/soc.c | static umode_t soc_attribute_mode(struct kobject *kobj, struct attribute *attr,
int index) {
struct device *dev = kobj_to_dev(kobj);
struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
if ((attr == &dev_attr_machine.attr) && soc_dev->attr->machine)
return... | [
0,
0
] |
Linux Kernel | drivers/base/soc.c |
static ssize_t soc_info_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
const char *output;
if (attr == &dev_attr_machine)
output = soc_dev->attr->machine;
else if (attr == &dev_attr_f... | [
0,
0
] |
Linux Kernel | drivers/base/soc.c |
static void soc_release(struct device *dev) {
struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
ida_simple_remove(&soc_ida, soc_dev->soc_dev_num);
kfree(soc_dev->dev.groups);
kfree(soc_dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
bool is_software_node(const struct fwnode_handle *fwnode) {
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &software_node_ops;
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
static const void *property_get_pointer(const struct property_entry *prop) {
if (!prop->length)
return NULL;
return prop->is_inline ? &prop->value : prop->pointer;
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c | static struct fwnode_handle *software_node_get(struct fwnode_handle *fwnode) {
struct swnode *swnode = to_swnode(fwnode);
kobject_get(&swnode->kobj);
return &swnode->fwnode;
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
static struct fwnode_handle *
software_node_get_parent(const struct fwnode_handle *fwnode) {
struct swnode *swnode = to_swnode(fwnode);
if (!swnode || !swnode->parent)
return NULL;
return fwnode_handle_get(&swnode->parent->fwnode);
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
static struct fwnode_handle *
software_node_get_next_child(const struct fwnode_handle *fwnode,
struct fwnode_handle *child) {
struct swnode *p = to_swnode(fwnode);
struct swnode *c = to_swnode(child);
if (!p || list_empty(&p->children) ||
(c && list_is_last(&c->entry, &p->chil... | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
static struct software_node *
software_node_alloc(const struct property_entry *properties) {
struct property_entry *props;
struct software_node *node;
props = property_entries_dup(properties);
if (IS_ERR(props))
return ERR_CAST(props);
node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node) {
prope... | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
static void software_node_release(struct kobject *kobj) {
struct swnode *swnode = kobj_to_swnode(kobj);
if (swnode->parent) {
ida_simple_remove(&swnode->parent->child_ids, swnode->id);
list_del(&swnode->entry);
} else {
ida_simple_remove(&swnode_root_ids, swnode->id);
}
if (swnode->allocated)
... | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c | int software_node_register_node_group(const struct software_node **node_group) {
unsigned int i;
int ret;
if (!node_group)
return 0;
for (i = 0; node_group[i]; i++) {
ret = software_node_register(node_group[i]);
if (ret) {
software_node_unregister_node_group(node_group);
return ret;
... | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c | int software_node_register(const struct software_node *node) {
struct swnode *parent = software_node_to_swnode(node->parent);
if (software_node_to_swnode(node))
return -EEXIST;
if (node->parent && !parent)
return -EINVAL;
return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0));
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
void fwnode_remove_software_node(struct fwnode_handle *fwnode) {
struct swnode *swnode = to_swnode(fwnode);
if (!swnode)
return;
kobject_put(&swnode->kobj);
} | [
0,
0
] |
Linux Kernel | drivers/base/swnode.c |
void software_node_notify_remove(struct device *dev) {
struct swnode *swnode;
swnode = dev_to_swnode(dev);
if (!swnode)
return;
sysfs_remove_link(&swnode->kobj, dev_name(dev));
sysfs_remove_link(&dev->kobj, "software_node");
kobject_put(&swnode->kobj);
if (swnode->managed) {
set_secondary_fwno... | [
0,
0
] |
Linux Kernel | drivers/base/syscore.c | void unregister_syscore_ops(struct syscore_ops *ops) {
mutex_lock(&syscore_ops_lock);
list_del(&ops->node);
mutex_unlock(&syscore_ops_lock);
} | [
0,
0
] |
Linux Kernel | drivers/base/syscore.c | void syscore_shutdown(void) {
struct syscore_ops *ops;
mutex_lock(&syscore_ops_lock);
list_for_each_entry_reverse(ops, &syscore_ops_list, node) if (ops->shutdown) {
if (initcall_debug)
pr_info("PM: Calling %pS\n", ops->shutdown);
ops->shutdown();
}
mutex_unlock(&syscore_ops_lock);
} | [
0,
0
] |
Linux Kernel | drivers/base/test/property-entry-test.c | static void pe_test_move_inline_str(struct kunit *test) {
static char *str_array_small[] = {"a"};
static char *str_array_big[] = {"b", "c", "d", "e"};
static char *str_array_small_empty[] = {""};
static struct property_entry entries[] = {
PROPERTY_ENTRY_STRING_ARRAY("small", str_array_small),
PROPER... | [
0,
0
] |
Linux Kernel | drivers/base/test/test_async_driver_probe.c | static int test_probe(struct platform_device *pdev) {
struct device *dev = &pdev->dev;
if (atomic_read(&timeout)) {
dev_err(dev, "async probe took too long\n");
atomic_inc(&errors);
} else {
dev_dbg(&pdev->dev, "sleeping for %d msecs in probe\n", TEST_PROBE_DELAY);
msleep(TEST_PROBE_DELAY);
d... | [
1,
0
] |
Linux Kernel | drivers/base/test/test_async_driver_probe.c |
static struct platform_device *
test_platform_device_register_node(char *name, int id, int nid) {
struct platform_device *pdev;
int ret;
pdev = platform_device_alloc(name, id);
if (!pdev)
return NULL;
if (nid != NUMA_NO_NODE)
set_dev_node(&pdev->dev, nid);
ret = platform_device_add(pdev);
if (... | [
0,
0
] |
Linux Kernel | drivers/base/topology.c | static int topology_add_dev(unsigned int cpu) {
struct device *dev = get_cpu_device(cpu);
return sysfs_create_group(&dev->kobj, &topology_attr_group);
} | [
0,
0
] |
Linux Kernel | drivers/base/topology.c |
static int topology_remove_dev(unsigned int cpu) {
struct device *dev = get_cpu_device(cpu);
sysfs_remove_group(&dev->kobj, &topology_attr_group);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/transport_class.c | void transport_class_unregister(struct transport_class *tclass) {
class_unregister(&tclass->class);
} | [
0,
0
] |
Linux Kernel | drivers/base/transport_class.c |
static int transport_add_class_device(struct attribute_container *cont,
struct device *dev,
struct device *classdev) {
int error = attribute_container_add_class_device(classdev);
struct transport_container *tcont =
attribute_containe... | [
1,
0
] |
Linux Kernel | drivers/base/transport_class.c | void transport_configure_device(struct device *dev) {
attribute_container_device_trigger(dev, transport_configure);
} | [
0,
0
] |
Linux Kernel | drivers/base/transport_class.c | void transport_remove_device(struct device *dev) {
attribute_container_device_trigger(dev, transport_remove_classdev);
} | [
0,
0
] |
Linux Kernel | drivers/base/transport_class.c | void transport_destroy_device(struct device *dev) {
attribute_container_remove_device(dev, transport_destroy_classdev);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/bcma_private.h | static inline int bcma_sflash_init(struct bcma_drv_cc *cc) {
bcma_err(cc->core->bus, "Serial flash not supported\n");
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/bcma_private.h | static inline void bcma_core_pci_init(struct bcma_drv_pci *pc) {
WARN_ON(pc->core->bus->hosttype == BCMA_HOSTTYPE_PCI);
}
#endif
/* driver_pcie2.c */ | [
1,
0
] |
Linux Kernel | drivers/bcma/bcma_private.h | static inline void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2) {
WARN_ON(pcie2->core->bus->hosttype == BCMA_HOSTTYPE_PCI);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/core.c |
static bool bcma_core_wait_value(struct bcma_device *core, u16 reg, u32 mask,
u32 value, int timeout) {
unsigned long deadline = jiffies + timeout;
u32 val;
do {
val = bcma_aread32(core, reg);
if ((val & mask) == value)
return true;
cpu_relax();
udelay(10);... | [
1,
0
] |
Linux Kernel | drivers/bcma/core.c |
void bcma_core_disable(struct bcma_device *core, u32 flags) {
if (bcma_aread32(core, BCMA_RESET_CTL) & BCMA_RESET_CTL_RESET)
return;
bcma_core_wait_value(core, BCMA_RESET_ST, ~0, 0, 300);
bcma_awrite32(core, BCMA_RESET_CTL, BCMA_RESET_CTL_RESET);
bcma_aread32(core, BCMA_RESET_CTL);
udelay(1);
bcma_a... | [
0,
0
] |
Linux Kernel | drivers/bcma/core.c |
int bcma_core_enable(struct bcma_device *core, u32 flags) {
bcma_core_disable(core, flags);
bcma_awrite32(core, BCMA_IOCTL, (BCMA_IOCTL_CLK | BCMA_IOCTL_FGC | flags));
bcma_aread32(core, BCMA_IOCTL);
bcma_awrite32(core, BCMA_RESET_CTL, 0);
bcma_aread32(core, BCMA_RESET_CTL);
udelay(1);
bcma_awrite32(c... | [
0,
0
] |
Linux Kernel | drivers/bcma/core.c |
u32 bcma_core_dma_translation(struct bcma_device *core) {
switch (core->bus->hosttype) {
case BCMA_HOSTTYPE_SOC:
return 0;
case BCMA_HOSTTYPE_PCI:
if (bcma_aread32(core, BCMA_IOST) & BCMA_IOST_DMA64)
return BCMA_DMA_TRANSLATION_DMA64_CMT;
else
return BCMA_DMA_TRANSLATION_DMA32_CMT;
defa... | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon.c |
static u32 bcma_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
u32 ticks) {
struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt);
return bcma_chipco_watchdog_timer_set(cc, ticks);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon.c | static int bcma_chipco_watchdog_ticks_per_ms(struct bcma_drv_cc *cc) {
struct bcma_bus *bus = cc->core->bus;
if (cc->capabilities & BCMA_CC_CAP_PMU) {
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
return bcma_chipco_get_alp_clock(cc) / 4000;
else
/* based on 32KHz ILP clock */
return 32;... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon.c |
u32 bcma_chipco_irq_status(struct bcma_drv_cc *cc, u32 mask) {
return bcma_cc_read32(cc, BCMA_CC_IRQSTAT) & mask;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon.c |
u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value) {
unsigned long flags;
u32 res;
spin_lock_irqsave(&cc->gpio_lock, flags);
res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOIRQ, mask, value);
spin_unlock_irqrestore(&cc->gpio_lock, flags);
return res;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_b.c |
static bool bcma_wait_reg(struct bcma_bus *bus, void __iomem *addr, u32 mask,
u32 value, int timeout) {
unsigned long deadline = jiffies + timeout;
u32 val;
do {
val = readl(addr);
if ((val & mask) == value)
return true;
cpu_relax();
udelay(10);
} while (!time_a... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_b.c |
void bcma_chipco_b_mii_write(struct bcma_drv_cc_b *ccb, u32 offset, u32 value) {
struct bcma_bus *bus = ccb->core->bus;
void __iomem *mii = ccb->mii;
writel(offset, mii + BCMA_CCB_MII_MNG_CTL);
bcma_wait_reg(bus, mii + BCMA_CCB_MII_MNG_CTL, 0x0100, 0x0000, 100);
writel(value, mii + BCMA_CCB_MII_MNG_CMD_DATA... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_pmu.c |
u32 bcma_chipco_pll_read(struct bcma_drv_cc *cc, u32 offset) {
bcma_pmu_write32(cc, BCMA_CC_PMU_PLLCTL_ADDR, offset);
bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_ADDR);
return bcma_pmu_read32(cc, BCMA_CC_PMU_PLLCTL_DATA);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_pmu.c |
void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, u32 offset, u32 mask,
u32 set) {
bcma_pmu_write32(cc, BCMA_CC_PMU_REGCTL_ADDR, offset);
bcma_pmu_read32(cc, BCMA_CC_PMU_REGCTL_ADDR);
bcma_pmu_maskset32(cc, BCMA_CC_PMU_REGCTL_DATA, mask, set);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_pmu.c |
void bcma_pmu_early_init(struct bcma_drv_cc *cc) {
struct bcma_bus *bus = cc->core->bus;
u32 pmucap;
if (cc->core->id.rev >= 35 &&
cc->capabilities_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) {
cc->pmu.core = bcma_find_core(bus, BCMA_CORE_PMU);
if (!cc->pmu.core)
bcma_warn(bus, "Couldn't find expecte... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_pmu.c | u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc) {
struct bcma_bus *bus = cc->core->bus;
switch (bus->chipinfo.id) {
case BCMA_CHIP_ID_BCM4313:
case BCMA_CHIP_ID_BCM43224:
case BCMA_CHIP_ID_BCM43225:
case BCMA_CHIP_ID_BCM43227:
case BCMA_CHIP_ID_BCM43228:
case BCMA_CHIP_ID_BCM4331:
case BCMA_CHIP_I... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_pmu.c | u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc) {
struct bcma_bus *bus = cc->core->bus;
switch (bus->chipinfo.id) {
case BCMA_CHIP_ID_BCM4716:
case BCMA_CHIP_ID_BCM4748:
case BCMA_CHIP_ID_BCM47162:
return bcma_pmu_pll_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
BCMA_CC_PMU5_M... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_chipcommon_sflash.c |
static void bcma_sflash_cmd(struct bcma_drv_cc *cc, u32 opcode) {
int i;
bcma_cc_write32(cc, BCMA_CC_FLASHCTL, BCMA_CC_FLASHCTL_START | opcode);
for (i = 0; i < 1000; i++) {
if (!(bcma_cc_read32(cc, BCMA_CC_FLASHCTL) & BCMA_CC_FLASHCTL_BUSY))
return;
cpu_relax();
}
bcma_err(cc->core->bus, "SFLA... | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static int bcma_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) {
struct bcma_drv_cc *cc = gpiochip_get_data(chip);
bcma_chipco_gpio_outen(cc, 1 << gpio, 0);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static void bcma_gpio_irq_unmask(struct irq_data *d) {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct bcma_drv_cc *cc = gpiochip_get_data(gc);
int gpio = irqd_to_hwirq(d);
u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
gpiochip_enable_irq(gc, gpio);
bcma_chipco_gpio_polarity(cc, BIT(gpio), va... | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static void bcma_gpio_irq_mask(struct irq_data *d) {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct bcma_drv_cc *cc = gpiochip_get_data(gc);
int gpio = irqd_to_hwirq(d);
bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
gpiochip_disable_irq(gc, gpio);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id) {
struct bcma_drv_cc *cc = dev_id;
struct gpio_chip *gc = &cc->gpio;
u32 val = bcma_cc_read32(cc, BCMA_CC_GPIOIN);
u32 mask = bcma_cc_read32(cc, BCMA_CC_GPIOIRQ);
u32 pol = bcma_cc_read32(cc, BCMA_CC_GPIOPOL);
unsigned long irqs = (val ^ pol) ... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c | static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) {
struct gpio_chip *chip = &cc->gpio;
struct gpio_irq_chip *girq = &chip->irq;
int hwirq, err;
if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
return 0;
hwirq = bcma_core_irq(cc->core, 0);
err = request_irq(hwirq, bcma_gpio_irq_handler, IRQF_SHAR... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc) {
if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
return;
bcma_cc_mask32(cc, BCMA_CC_IRQMASK, ~BCMA_CC_IRQ_GPIO);
free_irq(bcma_core_irq(cc->core, 0), cc);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c |
static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc) {}
#endif | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_gpio.c | int bcma_gpio_init(struct bcma_drv_cc *cc) {
struct bcma_bus *bus = cc->core->bus;
struct gpio_chip *chip = &cc->gpio;
int err;
chip->label = "bcma_gpio";
chip->owner = THIS_MODULE;
chip->request = bcma_gpio_request;
chip->free = bcma_gpio_free;
chip->get = bcma_gpio_get_value;
chip->set = bcma_gpio_... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_mips.c | static void bcma_fix_i2s_irqflag(struct bcma_bus *bus) {
struct bcma_device *cpu, *pcie, *i2s;
if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4716 &&
bus->chipinfo.id != BCMA_CHIP_ID_BCM4748)
return;
cpu = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
pcie = bcma_find_core(bus, BCMA_CORE_PCIE);
i2s = bcma_fin... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pci.c | static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u16 device,
u8 address, u16 data) {
int max_retries = 10;
u32 v;
int i;
v = BCMA_CORE_PCI_MDIOCTL_PREAM_EN;
v |= BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL;
pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, v);
if (pc->core-... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pci.c | void bcma_core_pci_early_init(struct bcma_drv_pci *pc) {
if (pc->early_setup_done)
return;
pc->hostmode = bcma_core_pci_is_in_hostmode(pc);
if (pc->hostmode)
goto out;
bcma_core_pci_fixcfg(pc);
out:
pc->early_setup_done = true;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_pci.c |
void bcma_core_pci_power_save(struct bcma_bus *bus, bool up) {
struct bcma_drv_pci *pc;
u16 data;
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;
pc = &bus->drv_pci[0];
if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
data = up ? 0x74 : 0x7C;
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_M... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pcie2.c |
static void bcma_core_pcie2_cfg_write(struct bcma_drv_pcie2 *pcie2, u32 addr,
u32 val) {
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, addr);
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, val);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_pcie2.c | static void bcma_core_pcie2_set_ltr_vals(struct bcma_drv_pcie2 *pcie2) {
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, 0x844);
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 0x883c883c);
/* LTR1 */
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, 0x848);
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CON... | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_pcie2.c | static void bcma_core_pcie2_hw_ltr_war(struct bcma_drv_pcie2 *pcie2) {
u8 core_rev = pcie2->core->id.rev;
u32 devstsctr2;
if (core_rev < 2 || core_rev == 10 || core_rev > 13)
return;
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR,
PCIE2_CAP_DEVSTSCTRL2_OFFSET);
devstsctr2 = pcie2_rea... | [
1,
1
] |
Linux Kernel | drivers/bcma/driver_pcie2.c | static void pciedev_crwlpciegen2(struct bcma_drv_pcie2 *pcie2) {
u8 core_rev = pcie2->core->id.rev;
bool pciewar160, pciewar162;
pciewar160 = core_rev == 7 || core_rev == 9 || core_rev == 11;
pciewar162 = core_rev == 5 || core_rev == 7 || core_rev == 8 ||
core_rev == 9 || core_rev == 11;
if (... | [
1,
1
] |
Linux Kernel | drivers/bcma/driver_pcie2.c |
static void pciedev_crwlpciegen2_182(struct bcma_drv_pcie2 *pcie2) {
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDADDR, PCIE2_SBMBX);
pcie2_write32(pcie2, BCMA_CORE_PCIE2_CONFIGINDDATA, 1 << 0);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/driver_pcie2.c | void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2) {
struct bcma_bus *bus = pcie2->core->bus;
struct pci_dev *dev = bus->host_pci;
int err;
err = pcie_set_readrq(dev, pcie2->reqsize);
if (err)
bcma_err(bus, "Error setting PCI_EXP_DEVCTL_READRQ: %d\n", err);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pci_host.c |
bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) {
struct bcma_bus *bus = pc->core->bus;
u16 chipid_top;
u32 tmp;
chipid_top = (bus->chipinfo.id & 0xFF00);
if (chipid_top != 0x4700 && chipid_top != 0x5300)
return false;
bcma_core_enable(pc->core, 0);
return !mips_busprobe32(tmp, pc->core... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pci_host.c | static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
unsigned int func, unsigned int off,
void *buf, int len) {
int err = -EINVAL;
u32 addr, val;
void __iomem *mmio = 0;
WARN_ON(!pc->hostmode);
if (unlikely(len != ... | [
1,
0
] |
Linux Kernel | drivers/bcma/driver_pci_host.c | int bcma_core_pci_plat_dev_init(struct pci_dev *dev) {
struct bcma_drv_pci_host *pc_host;
int readrq;
if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
return -ENODEV;
}
pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host, pci_ops);
pr_info("PCI: Fixing up device %s\n", pci_... | [
1,
0
] |
Linux Kernel | drivers/bcma/host_pci.c |
static void bcma_host_pci_switch_core(struct bcma_device *core) {
int win2 =
core->bus->host_is_pcie2 ? BCMA_PCIE2_BAR0_WIN2 : BCMA_PCI_BAR0_WIN2;
pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN, core->addr);
pci_write_config_dword(core->bus->host_pci, win2, core->wrap);
core->bus->mapped_... | [
0,
0
] |
Linux Kernel | drivers/bcma/host_pci.c |
static u8 bcma_host_pci_read8(struct bcma_device *core, u16 offset) {
offset += bcma_host_pci_provide_access_to_core(core);
return ioread8(core->bus->mmio + offset);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/host_pci.c |
static void bcma_host_pci_write8(struct bcma_device *core, u16 offset,
u8 value) {
offset += bcma_host_pci_provide_access_to_core(core);
iowrite8(value, core->bus->mmio + offset);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/host_pci.c |
static void bcma_host_pci_block_write(struct bcma_device *core,
const void *buffer, size_t count,
u16 offset, u8 reg_width) {
void __iomem *addr = core->bus->mmio + offset;
if (core->bus->mapped_core != core)
bcma_host_pci_switch_core(... | [
1,
0
] |
Linux Kernel | drivers/bcma/host_pci.c |
static u32 bcma_host_pci_aread32(struct bcma_device *core, u16 offset) {
if (core->bus->mapped_core != core)
bcma_host_pci_switch_core(core);
return ioread32(core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset);
} | [
1,
0
] |
Linux Kernel | drivers/bcma/host_soc.c |
static u8 bcma_host_soc_read8(struct bcma_device *core, u16 offset) {
return readb(core->io_addr + offset);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/host_soc.c |
static void bcma_host_soc_write16(struct bcma_device *core, u16 offset,
u16 value) {
writew(value, core->io_addr + offset);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/host_soc.c |
static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset,
u32 value) {
if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n"))
return;
writel(value, core->io_wrap + offset);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/host_soc.c |
static int bcma_host_soc_remove(struct platform_device *pdev) {
struct bcma_bus *bus = platform_get_drvdata(pdev);
bcma_bus_unregister(bus);
iounmap(bus->mmio);
platform_set_drvdata(pdev, NULL);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/host_soc.c | void __exit bcma_host_soc_unregister_driver(void) {
platform_driver_unregister(&bcma_host_soc_driver);
}
#endif | [
0,
0
] |
Linux Kernel | drivers/bcma/main.c |
static bool bcma_is_core_needed_early(u16 core_id) {
switch (core_id) {
case BCMA_CORE_NS_NAND:
case BCMA_CORE_NS_QSPI:
return true;
}
return false;
} | [
1,
0
] |
Linux Kernel | drivers/bcma/main.c |
static void bcma_of_fill_device(struct device *parent,
struct bcma_device *core) {
struct device_node *node;
node = bcma_of_find_child_device(parent, core);
if (node)
core->dev.of_node = node;
core->irq = bcma_of_get_irq(parent, core, 0);
of_dma_configure(&core->dev, no... | [
0,
0
] |
Linux Kernel | drivers/bcma/main.c |
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) {
device_initialize(&core->dev);
core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
core->dev.parent = bus->dev;
if (bus->dev)
bcma_of_fill_d... | [
1,
0
] |
Linux Kernel | drivers/bcma/main.c | void bcma_unregister_cores(struct bcma_bus *bus) {
struct bcma_device *core, *tmp;
list_for_each_entry_safe(core, tmp, &bus->cores, list) {
if (!core->dev_registered)
continue;
list_del(&core->list);
device_unregister(&core->dev);
}
if (bus->hosttype == BCMA_HOSTTYPE_SOC)
platform_device_... | [
0,
0
] |
Linux Kernel | drivers/bcma/main.c |
static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env) {
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
return add_uevent_var(env, "MODALIAS=bcma:m%04Xid%04Xrev%02Xcl%02X",
core->id.manuf, core->id.id, core->id.rev,
co... | [
0,
0
] |
Linux Kernel | drivers/bcma/main.c | static int __init bcma_init_bus_register(void) {
int err;
if (bcma_bus_registered)
return 0;
err = bus_register(&bcma_bus_type);
if (!err)
bcma_bus_registered = 1;
return err;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/main.c | static int __init bcma_modinit(void) {
int err;
err = bcma_init_bus_register();
if (err)
return err;
err = bcma_host_soc_register_driver();
if (err) {
pr_err("SoC host initialization failed\n");
err = 0;
}
#ifdef CONFIG_BCMA_HOST_PCI
err = bcma_host_pci_init();
if (err) {
pr_err("PCI h... | [
0,
0
] |
Linux Kernel | drivers/bcma/scan.c |
static u32 bcma_scan_read32(struct bcma_bus *bus, u16 offset) {
return readl(bus->mmio + offset);
} | [
0,
0
] |
Linux Kernel | drivers/bcma/scan.c |
static u32 bcma_erom_get_ent(struct bcma_bus *bus, u32 __iomem **eromptr) {
u32 ent = readl(*eromptr);
(*eromptr)++;
return ent;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/scan.c |
static void bcma_erom_skip_component(struct bcma_bus *bus,
u32 __iomem **eromptr) {
u32 ent;
while (1) {
ent = bcma_erom_get_ent(bus, eromptr);
if ((ent & SCAN_ER_VALID) && ((ent & SCAN_ER_TAG) == SCAN_ER_TAG_CI))
break;
if (ent == (SCAN_ER_TAG_END | SCAN_ER_V... | [
0,
0
] |
Linux Kernel | drivers/bcma/scan.c |
static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus,
u16 coreid) {
struct bcma_device *core;
list_for_each_entry_reverse(core, &bus->cores, list) {
if (core->id.id == coreid)
return core;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/sprom.c |
static int bcma_sprom_check_crc(const u16 *sprom, size_t words) {
u8 crc;
u8 expected_crc;
u16 tmp;
crc = bcma_sprom_crc(sprom, words);
tmp = sprom[words - 1] & SSB_SPROM_REVISION_CRC;
expected_crc = tmp >> SSB_SPROM_REVISION_CRC_SHIFT;
if (crc != expected_crc)
return -EPROTO;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bcma/sprom.c | static bool bcma_sprom_ext_available(struct bcma_bus *bus) {
u32 chip_status;
u32 srom_control;
u32 present_mask;
if (bus->drv_cc.core->id.rev >= 31) {
if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
return false;
srom_control = bcma_read32(bus->drv_cc.core, BCMA_CC_SROM_CONTROL);
retur... | [
1,
0
] |
Linux Kernel | drivers/block/amiflop.c | static inline int try_fdc(int drive) {
drive &= 3;
return ((fdc_busy < 0) || (fdc_busy == drive));
} | [
0,
0
] |
Linux Kernel | drivers/block/amiflop.c |
static void get_fdc(int drive) {
unsigned long flags;
drive &= 3;
#ifdef DEBUG
printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n", drive, fdc_busy,
fdc_nested);
#endif
local_irq_save(flags);
wait_event(fdc_wait, try_fdc(drive));
fdc_busy = drive;
fdc_nested++;
local_irq_restore(flags);
... | [
0,
0
] |
Linux Kernel | drivers/block/amiflop.c |
static void fd_select(int drive) {
unsigned char prb = ~0;
drive &= 3;
#ifdef DEBUG
printk("selecting %d\n", drive);
#endif
if (drive == selected)
return;
get_fdc(drive);
selected = drive;
if (unit[drive].track % 2 != 0)
prb &= ~DSKSIDE;
if (unit[drive].motor == 1)
prb &= ~DSKMOTOR;
cia... | [
1,
0
] |
Linux Kernel | drivers/block/amiflop.c |
static void fd_deselect(int drive) {
unsigned char prb;
unsigned long flags;
drive &= 3;
#ifdef DEBUG
printk("deselecting %d\n", drive);
#endif
if (drive != selected) {
printk(KERN_WARNING "Deselecting drive %d while %d was selected!\n", drive,
selected);
return;
}
get_fdc(drive);
... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.