Release 4.14 arch/sparc/kernel/auxio_64.c
// SPDX-License-Identifier: GPL-2.0
/* auxio.c: Probing for the Sparc AUXIO register at boot time.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*
* Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net)
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/of_device.h>
#include <asm/prom.h>
#include <asm/io.h>
#include <asm/auxio.h>
void __iomem *auxio_register = NULL;
EXPORT_SYMBOL(auxio_register);
enum auxio_type {
AUXIO_TYPE_NODEV,
AUXIO_TYPE_SBUS,
AUXIO_TYPE_EBUS
};
static enum auxio_type auxio_devtype = AUXIO_TYPE_NODEV;
static DEFINE_SPINLOCK(auxio_lock);
static void __auxio_rmw(u8 bits_on, u8 bits_off, int ebus)
{
if (auxio_register) {
unsigned long flags;
u8 regval, newval;
spin_lock_irqsave(&auxio_lock, flags);
regval = (ebus ?
(u8) readl(auxio_register) :
sbus_readb(auxio_register));
newval = regval | bits_on;
newval &= ~bits_off;
if (!ebus)
newval &= ~AUXIO_AUX1_MASK;
if (ebus)
writel((u32) newval, auxio_register);
else
sbus_writeb(newval, auxio_register);
spin_unlock_irqrestore(&auxio_lock, flags);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Brower | 77 | 71.30% | 1 | 50.00% |
David S. Miller | 31 | 28.70% | 1 | 50.00% |
Total | 108 | 100.00% | 2 | 100.00% |
static void __auxio_set_bit(u8 bit, int on, int ebus)
{
u8 bits_on = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED);
u8 bits_off = 0;
if (!on) {
u8 tmp = bits_off;
bits_off = bits_on;
bits_on = tmp;
}
__auxio_rmw(bits_on, bits_off, ebus);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 40 | 66.67% | 1 | 50.00% |
Eric Brower | 20 | 33.33% | 1 | 50.00% |
Total | 60 | 100.00% | 2 | 100.00% |
void auxio_set_led(int on)
{
int ebus = auxio_devtype == AUXIO_TYPE_EBUS;
u8 bit;
bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED);
__auxio_set_bit(bit, on, ebus);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 23 | 62.16% | 1 | 50.00% |
Eric Brower | 14 | 37.84% | 1 | 50.00% |
Total | 37 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(auxio_set_led);
static void __auxio_sbus_set_lte(int on)
{
__auxio_set_bit(AUXIO_AUX1_LTE, on, 0);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Brower | 15 | 83.33% | 1 | 50.00% |
David S. Miller | 3 | 16.67% | 1 | 50.00% |
Total | 18 | 100.00% | 2 | 100.00% |
void auxio_set_lte(int on)
{
switch(auxio_devtype) {
case AUXIO_TYPE_SBUS:
__auxio_sbus_set_lte(on);
break;
case AUXIO_TYPE_EBUS:
/* FALL-THROUGH */
default:
break;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Brower | 29 | 100.00% | 1 | 100.00% |
Total | 29 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(auxio_set_lte);
static const struct of_device_id auxio_match[] = {
{
.name = "auxio",
},
{},
};
MODULE_DEVICE_TABLE(of, auxio_match);
static int auxio_probe(struct platform_device *dev)
{
struct device_node *dp = dev->dev.of_node;
unsigned long size;
if (!strcmp(dp->parent->name, "ebus")) {
auxio_devtype = AUXIO_TYPE_EBUS;
size = sizeof(u32);
} else if (!strcmp(dp->parent->name, "sbus")) {
auxio_devtype = AUXIO_TYPE_SBUS;
size = 1;
} else {
printk("auxio: Unknown parent bus type [%s]\n",
dp->parent->name);
return -ENODEV;
}
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
if (!auxio_register)
return -ENODEV;
printk(KERN_INFO "AUXIO: Found device at %s\n",
dp->full_name);
if (auxio_devtype == AUXIO_TYPE_EBUS)
auxio_set_led(AUXIO_LED_ON);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 116 | 78.38% | 3 | 30.00% |
Linus Torvalds (pre-git) | 15 | 10.14% | 4 | 40.00% |
Eric Brower | 13 | 8.78% | 1 | 10.00% |
Grant C. Likely | 4 | 2.70% | 2 | 20.00% |
Total | 148 | 100.00% | 10 | 100.00% |
static struct platform_driver auxio_driver = {
.probe = auxio_probe,
.driver = {
.name = "auxio",
.of_match_table = auxio_match,
},
};
static int __init auxio_init(void)
{
return platform_driver_register(&auxio_driver);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 14 | 87.50% | 2 | 50.00% |
Grant C. Likely | 1 | 6.25% | 1 | 25.00% |
Linus Torvalds (pre-git) | 1 | 6.25% | 1 | 25.00% |
Total | 16 | 100.00% | 4 | 100.00% |
/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the floppy driver
* need to use the AUXIO register.
*/
fs_initcall(auxio_init);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 278 | 51.01% | 9 | 36.00% |
Eric Brower | 190 | 34.86% | 1 | 4.00% |
Linus Torvalds (pre-git) | 39 | 7.16% | 6 | 24.00% |
Stephen Rothwell | 12 | 2.20% | 2 | 8.00% |
Grant C. Likely | 11 | 2.02% | 4 | 16.00% |
Sam Ravnborg | 10 | 1.83% | 1 | 4.00% |
Thomas Gleixner | 4 | 0.73% | 1 | 4.00% |
Greg Kroah-Hartman | 1 | 0.18% | 1 | 4.00% |
Total | 545 | 100.00% | 25 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.