Exemplo n.º 1
0
SYSFS_PMCSETUP(der, SPRN_PA6T_DER);
SYSFS_PMCSETUP(mer, SPRN_PA6T_MER);
SYSFS_PMCSETUP(ber, SPRN_PA6T_BER);
SYSFS_PMCSETUP(ier, SPRN_PA6T_IER);
SYSFS_PMCSETUP(sier, SPRN_PA6T_SIER);
SYSFS_PMCSETUP(siar, SPRN_PA6T_SIAR);
SYSFS_PMCSETUP(tsr0, SPRN_PA6T_TSR0);
SYSFS_PMCSETUP(tsr1, SPRN_PA6T_TSR1);
SYSFS_PMCSETUP(tsr2, SPRN_PA6T_TSR2);
SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3);
#endif /* CONFIG_DEBUG_KERNEL */
#endif /* HAS_PPC_PMC_PA6T */

#ifdef HAS_PPC_PMC_IBM
static struct sysdev_attribute ibm_common_attrs[] = {
	_SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
	_SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
};
#endif /* HAS_PPC_PMC_G4 */

#ifdef HAS_PPC_PMC_G4
static struct sysdev_attribute g4_common_attrs[] = {
	_SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
	_SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
	_SYSDEV_ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2),
};
#endif /* HAS_PPC_PMC_G4 */

static struct sysdev_attribute classic_pmc_attrs[] = {
	_SYSDEV_ATTR(pmc1, 0600, show_pmc1, store_pmc1),
	_SYSDEV_ATTR(pmc2, 0600, show_pmc2, store_pmc2),
Exemplo n.º 2
0
SYSFS_PMCSETUP(pa6t_pmc0, SPRN_PA6T_PMC0);
SYSFS_PMCSETUP(pa6t_pmc1, SPRN_PA6T_PMC1);
SYSFS_PMCSETUP(pa6t_pmc2, SPRN_PA6T_PMC2);
SYSFS_PMCSETUP(pa6t_pmc3, SPRN_PA6T_PMC3);
SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4);
SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5);


static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL);
static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr);
static SYSDEV_ATTR(purr, 0600, show_purr, store_purr);

static struct sysdev_attribute ibm_common_attrs[] = {
	_SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
	_SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
};

static struct sysdev_attribute ibm_pmc_attrs[] = {
	_SYSDEV_ATTR(pmc1, 0600, show_pmc1, store_pmc1),
	_SYSDEV_ATTR(pmc2, 0600, show_pmc2, store_pmc2),
	_SYSDEV_ATTR(pmc3, 0600, show_pmc3, store_pmc3),
	_SYSDEV_ATTR(pmc4, 0600, show_pmc4, store_pmc4),
	_SYSDEV_ATTR(pmc5, 0600, show_pmc5, store_pmc5),
	_SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6),
	_SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7),
	_SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8),
};

static struct sysdev_attribute pa6t_attrs[] = {
Exemplo n.º 3
0
            sprintf(sensor_name, "0x5ca-5.0Mp-AF");
            break;
        default:
            sprintf(sensor_name, "No sensor or error ID!");
            break;
    }

    return snprintf(buf, PAGE_SIZE, "%s\n", sensor_name);
}

/*
 * LIJING_CAM_20100613
 * modify file permission from 0400->0404
 */
static struct sysdev_attribute sensorinfo_files[] = {
    _SYSDEV_ATTR(id, 0404, sensorinfo_show_id, NULL),
    _SYSDEV_ATTR(name, 0404, sensorinfo_show_name, NULL),
};

static void sensorinfo_create_files(struct sys_device *dev,
                                        struct sysdev_attribute files[],
                                        int size)
{
    int i;

    for (i = 0; i < size; i++) {
        int err = sysdev_create_file(dev, &files[i]);
        if (err) {
            pr_err("%s: sysdev_create_file(%s)=%d\n",
                   __func__, files[i].attr.name, err);
            return;
Exemplo n.º 4
0
            sprintf(sensor_name, "SP0A28-0.3Mp-FF");
            break;
			
        default:
            sprintf(sensor_name, "No sensor or error ID!");
            break;
    }

    return snprintf(buf, PAGE_SIZE, "%s\n", sensor_name);
}
/*
 * LIJING_CAM_20100613
 * modify file permission from 0400->0404
 */
static struct sysdev_attribute back_sensorinfo_files[] = {
    _SYSDEV_ATTR(id, 0404, back_sensorinfo_show_id, NULL),
    _SYSDEV_ATTR(name, 0404, back_sensorinfo_show_name, NULL),
};

static struct sysdev_attribute front_sensorinfo_files[] = {
    _SYSDEV_ATTR(id, 0404, front_sensorinfo_show_id, NULL),
    _SYSDEV_ATTR(name, 0404, front_sensorinfo_show_name, NULL),
};

static void sensorinfo_create_files(struct sys_device *dev,
                                        struct sysdev_attribute files[],
                                        int size)
{
    int i;

    for (i = 0; i < size; i++) {
Exemplo n.º 5
0
	ret = scm_call(SCM_SVC_FUSE, QFPROM_ROW_ROLLBACK_WRITE_CMD,
				&wrip, sizeof(wrip), NULL, 0);

	if (ret && qfprom_api_status) {
		pr_err("%s: Error in QFPROM write (%d, 0x%x)\n",
				__func__, ret, qfprom_api_status);
		return ret;
	}

	/* Return the count argument since entire buffer is used */
	return count;
}

static struct sysdev_attribute qfprom_files[] = {
	_SYSDEV_ATTR(version, 0666, qfprom_show_version,
					qfprom_store_version),
};

static struct sysdev_class qfprom_sysdev_class = {
	.name = "qfprom",
};

static struct sys_device qfprom_sys_device = {
	.id = 0,
	.cls = &qfprom_sysdev_class,
};

static int __init qfprom_create_files(struct sys_device *dev,
					struct sysdev_attribute files[],
					int size)
{
Exemplo n.º 6
0
		struct sysdev_attribute *attr, char *buf) \
{ \
	cpuinfo_sparc *c = &cpu_data(dev->id); \
	return sprintf(buf, "%u\n", c->MEMBER); \
}

SHOW_CPUDATA_ULONG_NAME(clock_tick, clock_tick);
SHOW_CPUDATA_UINT_NAME(l1_dcache_size, dcache_size);
SHOW_CPUDATA_UINT_NAME(l1_dcache_line_size, dcache_line_size);
SHOW_CPUDATA_UINT_NAME(l1_icache_size, icache_size);
SHOW_CPUDATA_UINT_NAME(l1_icache_line_size, icache_line_size);
SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size);
SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size);

static struct sysdev_attribute cpu_core_attrs[] = {
	_SYSDEV_ATTR(clock_tick,          0444, show_clock_tick, NULL),
	_SYSDEV_ATTR(l1_dcache_size,      0444, show_l1_dcache_size, NULL),
	_SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL),
	_SYSDEV_ATTR(l1_icache_size,      0444, show_l1_icache_size, NULL),
	_SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL),
	_SYSDEV_ATTR(l2_cache_size,       0444, show_l2_cache_size, NULL),
	_SYSDEV_ATTR(l2_cache_line_size,  0444, show_l2_cache_line_size, NULL),
};

static DEFINE_PER_CPU(struct cpu, cpu_devices);

static void register_cpu_online(unsigned int cpu)
{
	struct cpu *c = &per_cpu(cpu_devices, cpu);
	struct sys_device *s = &c->sysdev;
	int i;