#include "bcma_private.h"
#include <linux/module.h>
#include <linux/mmc/sdio_func.h>
#include <linux/platform_device.h>
#include <linux/bcma/bcma.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
static unsigned int bcma_bus_next_num = 0;
static DEFINE_MUTEX(bcma_buses_mutex);
static int bcma_bus_match(struct device *dev, struct device_driver *drv);
static int bcma_device_probe(struct device *dev);
static int bcma_device_remove(struct device *dev);
static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
return sprintf(buf, "0x%03X\n", core->id.manuf);
static DEVICE_ATTR_RO(manuf);
static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf)
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
return sprintf(buf, "0x%03X\n", core->id.id);
static DEVICE_ATTR_RO(id);
static ssize_t rev_show(struct device *dev, struct device_attribute *attr, char *buf)
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
return sprintf(buf, "0x%02X\n", core->id.rev);
static DEVICE_ATTR_RO(rev);
static ssize_t class_show(struct device *dev, struct device_attribute *attr, char *buf)
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
return sprintf(buf, "0x%X\n", core->id.class);
static DEVICE_ATTR_RO(class);
static struct attribute *bcma_device_attrs[] = {
ATTRIBUTE_GROUPS(bcma_device);
static struct bus_type bcma_bus_type = {
.probe = bcma_device_probe,
.remove = bcma_device_remove,
.uevent = bcma_device_uevent,
.dev_groups = bcma_device_groups,
static u16 bcma_cc_core_id(struct bcma_bus *bus)
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
return BCMA_CORE_4706_CHIPCOMMON;
return BCMA_CORE_CHIPCOMMON;
struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
struct bcma_device *core;
list_for_each_entry(core, &bus->cores, list) {
if (core->id.id == coreid && core->core_unit == unit)