mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (79 commits) arm: bus_id -> dev_name() and dev_set_name() conversions sparc64: fix up bus_id changes in sparc core code 3c59x: handle pci_name() being const MTD: handle pci_name() being const HP iLO driver sysdev: Convert the x86 mce tolerant sysdev attribute to generic attribute sysdev: Add utility functions for simple int/ulong variable sysdev attributes sysdev: Pass the attribute to the low level sysdev show/store function driver core: Suppress sysfs warnings for device_rename(). kobject: Transmit return value of call_usermodehelper() to caller sysfs-rules.txt: reword API stability statement debugfs: Implement debugfs_remove_recursive() HOWTO: change email addresses of James in HOWTO always enable FW_LOADER unless EMBEDDED=y uio-howto.tmpl: use unique output names uio-howto.tmpl: use standard copyright/legal markings sysfs: don't call notify_change sysdev: fix debugging statements in registration code. kobject: should use kobject_put() in kset-example kobject: reorder kobject to save space on 64 bit builds ...
This commit is contained in:
commit
53baaaa968
173 files changed
+2525
-768
No files matched your search
@@ -0,0 +1,20 @@
|
||||
What: /sys/dev
|
||||
Date: April 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Dan Williams <dan.j.williams@intel.com>
|
||||
Description: The /sys/dev tree provides a method to look up the sysfs
|
||||
path for a device using the information returned from
|
||||
stat(2). There are two directories, 'block' and 'char',
|
||||
beneath /sys/dev containing symbolic links with names of
|
||||
the form "<major>:<minor>". These links point to the
|
||||
corresponding sysfs path for the given device.
|
||||
|
||||
Example:
|
||||
$ readlink /sys/dev/block/8:32
|
||||
../../block/sdc
|
||||
|
||||
Entries in /sys/dev/char and /sys/dev/block will be
|
||||
dynamically created and destroyed as devices enter and
|
||||
leave the system.
|
||||
|
||||
Users: mdadm <linux-raid@vger.kernel.org>
|
||||
@@ -21,6 +21,18 @@
|
||||
</affiliation>
|
||||
</author>
|
||||
|
||||
<copyright>
|
||||
<year>2006-2008</year>
|
||||
<holder>Hans-Jürgen Koch.</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
<para>
|
||||
This documentation is Free Software licensed under the terms of the
|
||||
GPL version 2.
|
||||
</para>
|
||||
</legalnotice>
|
||||
|
||||
<pubdate>2006-12-11</pubdate>
|
||||
|
||||
<abstract>
|
||||
@@ -29,6 +41,12 @@
|
||||
</abstract>
|
||||
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>0.5</revnumber>
|
||||
<date>2008-05-22</date>
|
||||
<authorinitials>hjk</authorinitials>
|
||||
<revremark>Added description of write() function.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>0.4</revnumber>
|
||||
<date>2007-11-26</date>
|
||||
@@ -57,20 +75,9 @@
|
||||
</bookinfo>
|
||||
|
||||
<chapter id="aboutthisdoc">
|
||||
<?dbhtml filename="about.html"?>
|
||||
<?dbhtml filename="aboutthis.html"?>
|
||||
<title>About this document</title>
|
||||
|
||||
<sect1 id="copyright">
|
||||
<?dbhtml filename="copyright.html"?>
|
||||
<title>Copyright and License</title>
|
||||
<para>
|
||||
Copyright (c) 2006 by Hans-Jürgen Koch.</para>
|
||||
<para>
|
||||
This documentation is Free Software licensed under the terms of the
|
||||
GPL version 2.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="translations">
|
||||
<?dbhtml filename="translations.html"?>
|
||||
<title>Translations</title>
|
||||
@@ -189,6 +196,30 @@ interested in translating it, please email me
|
||||
represents the total interrupt count. You can use this number
|
||||
to figure out if you missed some interrupts.
|
||||
</para>
|
||||
<para>
|
||||
For some hardware that has more than one interrupt source internally,
|
||||
but not separate IRQ mask and status registers, there might be
|
||||
situations where userspace cannot determine what the interrupt source
|
||||
was if the kernel handler disables them by writing to the chip's IRQ
|
||||
register. In such a case, the kernel has to disable the IRQ completely
|
||||
to leave the chip's register untouched. Now the userspace part can
|
||||
determine the cause of the interrupt, but it cannot re-enable
|
||||
interrupts. Another cornercase is chips where re-enabling interrupts
|
||||
is a read-modify-write operation to a combined IRQ status/acknowledge
|
||||
register. This would be racy if a new interrupt occurred
|
||||
simultaneously.
|
||||
</para>
|
||||
<para>
|
||||
To address these problems, UIO also implements a write() function. It
|
||||
is normally not used and can be ignored for hardware that has only a
|
||||
single interrupt source or has separate IRQ mask and status registers.
|
||||
If you need it, however, a write to <filename>/dev/uioX</filename>
|
||||
will call the <function>irqcontrol()</function> function implemented
|
||||
by the driver. You have to write a 32-bit value that is usually either
|
||||
0 or 1 to disable or enable interrupts. If a driver does not implement
|
||||
<function>irqcontrol()</function>, <function>write()</function> will
|
||||
return with <varname>-ENOSYS</varname>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To handle interrupts properly, your custom kernel module can
|
||||
@@ -362,6 +393,14 @@ device is actually used.
|
||||
<function>open()</function>, you will probably also want a custom
|
||||
<function>release()</function> function.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on)
|
||||
</varname>: Optional. If you need to be able to enable or disable
|
||||
interrupts from userspace by writing to <filename>/dev/uioX</filename>,
|
||||
you can implement this function. The parameter <varname>irq_on</varname>
|
||||
will be 0 to disable interrupts and 1 to enable them.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
|
||||
+1
-1
@@ -358,7 +358,7 @@ Here is a list of some of the different kernel trees available:
|
||||
- pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
|
||||
git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
|
||||
|
||||
- SCSI, James Bottomley <James.Bottomley@SteelEye.com>
|
||||
- SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
|
||||
git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
|
||||
|
||||
- x86, Ingo Molnar <mingo@elte.hu>
|
||||
|
||||
@@ -248,6 +248,7 @@ The top level sysfs directory looks like:
|
||||
block/
|
||||
bus/
|
||||
class/
|
||||
dev/
|
||||
devices/
|
||||
firmware/
|
||||
net/
|
||||
@@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each
|
||||
filesystem wanting to export attributes must create its own hierarchy
|
||||
below fs/ (see ./fuse.txt for an example).
|
||||
|
||||
dev/ contains two directories char/ and block/. Inside these two
|
||||
directories there are symlinks named <major>:<minor>. These symlinks
|
||||
point to the sysfs directory for the given device. /sys/dev provides a
|
||||
quick way to lookup the sysfs interface for a device from the result of
|
||||
a stat(2) operation.
|
||||
|
||||
More information can driver-model specific features can be found in
|
||||
Documentation/driver-model/.
|
||||
|
||||
@@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs
|
||||
The kernel-exported sysfs exports internal kernel implementation details
|
||||
and depends on internal kernel structures and layout. It is agreed upon
|
||||
by the kernel developers that the Linux kernel does not provide a stable
|
||||
internal API. As sysfs is a direct export of kernel internal
|
||||
structures, the sysfs interface cannot provide a stable interface either;
|
||||
it may always change along with internal kernel changes.
|
||||
internal API. Therefore, there are aspects of the sysfs interface that
|
||||
may not be stable across kernel releases.
|
||||
|
||||
To minimize the risk of breaking users of sysfs, which are in most cases
|
||||
low-level userspace applications, with a new kernel release, the users
|
||||
|
||||
@@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
|
||||
|
||||
device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
|
||||
if (!device_info) {
|
||||
printk(KERN_ERR
|
||||
"Could not allocated dmabounce_device_info for %s",
|
||||
dev->bus_id);
|
||||
dev_err(dev,
|
||||
"Could not allocated dmabounce_device_info\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
|
||||
|
||||
dev->archdata.dmabounce = device_info;
|
||||
|
||||
printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
|
||||
dev->bus_id, dev->bus->name);
|
||||
dev_info(dev, "dmabounce: registered device\n");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev)
|
||||
dev->archdata.dmabounce = NULL;
|
||||
|
||||
if (!device_info) {
|
||||
printk(KERN_WARNING
|
||||
"%s: Never registered with dmabounce but attempting" \
|
||||
"to unregister!\n", dev->bus_id);
|
||||
dev_warn(dev,
|
||||
"Never registered with dmabounce but attempting"
|
||||
"to unregister!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list_empty(&device_info->safe_buffers)) {
|
||||
printk(KERN_ERR
|
||||
"%s: Removing from dmabounce with pending buffers!\n",
|
||||
dev->bus_id);
|
||||
dev_err(dev,
|
||||
"Removing from dmabounce with pending buffers!\n");
|
||||
BUG();
|
||||
}
|
||||
|
||||
@@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev)
|
||||
|
||||
kfree(device_info);
|
||||
|
||||
printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
|
||||
dev->bus_id, dev->bus->name);
|
||||
dev_info(dev, "dmabounce: device unregistered\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -543,7 +543,6 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
||||
goto out;
|
||||
}
|
||||
|
||||
strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
|
||||
/*
|
||||
* If the parent device has a DMA mask associated with it,
|
||||
* propagate it down to the children.
|
||||
@@ -553,6 +552,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
||||
dev->dev.dma_mask = &dev->dma_mask;
|
||||
}
|
||||
|
||||
dev_set_name(&dev->dev, "%s", info->name);
|
||||
dev->devid = info->devid;
|
||||
dev->dev.parent = lchip->dev;
|
||||
dev->dev.bus = &locomo_bus_type;
|
||||
|
||||
@@ -550,9 +550,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
||||
goto out;
|
||||
}
|
||||
|
||||
snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
|
||||
"%4.4lx", info->offset);
|
||||
|
||||
dev_set_name(&dev->dev, "%4.4lx", info->offset);
|
||||
dev->devid = info->devid;
|
||||
dev->dev.parent = sachip->dev;
|
||||
dev->dev.bus = &sa1111_bus_type;
|
||||
@@ -560,7 +558,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
||||
dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
|
||||
dev->res.start = sachip->phys + info->offset;
|
||||
dev->res.end = dev->res.start + 511;
|
||||
dev->res.name = dev->dev.bus_id;
|
||||
dev->res.name = dev_name(&dev->dev);
|
||||
dev->res.flags = IORESOURCE_MEM;
|
||||
dev->mapbase = sachip->base + info->offset;
|
||||
dev->skpcr_mask = info->skpcr_mask;
|
||||
@@ -570,6 +568,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
||||
if (ret) {
|
||||
printk("SA1111: failed to allocate resource for %s\n",
|
||||
dev->res.name);
|
||||
dev_set_name(&dev->dev, NULL);
|
||||
kfree(dev);
|
||||
goto out;
|
||||
}
|
||||
@@ -593,7 +592,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
||||
if (dev->dma_mask != 0xffffffffUL) {
|
||||
ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
|
||||
if (ret) {
|
||||
printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
|
||||
dev_err(&dev->dev, "SA1111: Failed to register"
|
||||
" with dmabounce\n");
|
||||
device_unregister(&dev->dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ static int __devinit scoop_probe(struct platform_device *pdev)
|
||||
devptr->gpio.base = -1;
|
||||
|
||||
if (inf->gpio_base != 0) {
|
||||
devptr->gpio.label = pdev->dev.bus_id;
|
||||
devptr->gpio.label = dev_name(&pdev->dev);
|
||||
devptr->gpio.base = inf->gpio_base;
|
||||
devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
|
||||
devptr->gpio.set = scoop_gpio_set;
|
||||
|
||||
@@ -783,7 +783,7 @@ static void ecard_proc_init(void)
|
||||
|
||||
#define ec_set_resource(ec,nr,st,sz) \
|
||||
do { \
|
||||
(ec)->resource[nr].name = ec->dev.bus_id; \
|
||||
(ec)->resource[nr].name = dev_name(&ec->dev); \
|
||||
(ec)->resource[nr].start = st; \
|
||||
(ec)->resource[nr].end = (st) + (sz) - 1; \
|
||||
(ec)->resource[nr].flags = IORESOURCE_MEM; \
|
||||
@@ -853,8 +853,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
|
||||
for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
|
||||
if (ec->resource[i].flags &&
|
||||
request_resource(&iomem_resource, &ec->resource[i])) {
|
||||
printk(KERN_ERR "%s: resource(s) not available\n",
|
||||
ec->dev.bus_id);
|
||||
dev_err(&ec->dev, "resource(s) not available\n");
|
||||
ec->resource[i].end -= ec->resource[i].start;
|
||||
ec->resource[i].start = 0;
|
||||
ec->resource[i].flags = 0;
|
||||
|
||||
@@ -130,7 +130,9 @@ static const struct leds_evt_name evt_names[] = {
|
||||
{ "red", led_red_on, led_red_off },
|
||||
};
|
||||
|
||||
static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size)
|
||||
static ssize_t leds_store(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
int ret = -EINVAL, len = strcspn(buf, " ");
|
||||
|
||||
|
||||
@@ -393,9 +393,7 @@ static int impd1_probe(struct lm_device *dev)
|
||||
if (!d)
|
||||
continue;
|
||||
|
||||
snprintf(d->dev.bus_id, sizeof(d->dev.bus_id),
|
||||
"lm%x:%5.5lx", dev->id, idev->offset >> 12);
|
||||
|
||||
dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
|
||||
d->dev.parent = &dev->dev;
|
||||
d->res.start = dev->resource.start + idev->offset;
|
||||
d->res.end = d->res.start + SZ_4K - 1;
|
||||
@@ -407,8 +405,7 @@ static int impd1_probe(struct lm_device *dev)
|
||||
|
||||
ret = amba_device_register(d, &dev->resource);
|
||||
if (ret) {
|
||||
printk("unable to register device %s: %d\n",
|
||||
d->dev.bus_id, ret);
|
||||
dev_err(&d->dev, "unable to register device: %d\n");
|
||||
kfree(d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,10 @@ int lm_device_register(struct lm_device *dev)
|
||||
dev->dev.release = lm_device_release;
|
||||
dev->dev.bus = &lm_bustype;
|
||||
|
||||
snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), "lm%d", dev->id);
|
||||
dev->resource.name = dev->dev.bus_id;
|
||||
ret = dev_set_name(&dev->dev, "lm%d", dev->id);
|
||||
if (ret)
|
||||
return ret;
|
||||
dev->resource.name = dev_name(&dev->dev);
|
||||
|
||||
ret = request_resource(&iomem_resource, &dev->resource);
|
||||
if (ret == 0) {
|
||||
|
||||
@@ -334,7 +334,7 @@ static int omap_mbox_init(struct omap_mbox *mbox)
|
||||
}
|
||||
|
||||
mbox->dev.class = &omap_mbox_class;
|
||||
strlcpy(mbox->dev.bus_id, mbox->name, KOBJ_NAME_LEN);
|
||||
dev_set_name(&mbox->dev, "%s", mbox->name);
|
||||
dev_set_drvdata(&mbox->dev, mbox);
|
||||
|
||||
ret = device_register(&mbox->dev);
|
||||
|
||||
+25
-13
@@ -26,14 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||
* XXX: If/when a SMP-capable implementation of AVR32 will ever be
|
||||
* made, we must make sure that the code executes on the correct CPU.
|
||||
*/
|
||||
static ssize_t show_pc0event(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pc0event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f);
|
||||
}
|
||||
static ssize_t store_pc0event(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_pc0event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -46,15 +48,17 @@ static ssize_t store_pc0event(struct sys_device *dev, const char *buf,
|
||||
sysreg_write(PCCR, val);
|
||||
return count;
|
||||
}
|
||||
static ssize_t show_pc0count(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pc0count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pcnt0;
|
||||
|
||||
pcnt0 = sysreg_read(PCNT0);
|
||||
return sprintf(buf, "%lu\n", pcnt0);
|
||||
}
|
||||
static ssize_t store_pc0count(struct sys_device *dev, const char *buf,
|
||||
size_t count)
|
||||
static ssize_t store_pc0count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
char *endp;
|
||||
@@ -67,14 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev, const char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pc1event(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pc1event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f);
|
||||
}
|
||||
static ssize_t store_pc1event(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_pc1event(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -87,14 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev, const char *buf,
|
||||
sysreg_write(PCCR, val);
|
||||
return count;
|
||||
}
|
||||
static ssize_t show_pc1count(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pc1count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pcnt1;
|
||||
|
||||
pcnt1 = sysreg_read(PCNT1);
|
||||
return sprintf(buf, "%lu\n", pcnt1);
|
||||
}
|
||||
static ssize_t store_pc1count(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_pc1count(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -108,14 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev, const char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pccycles(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pccycles(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccnt;
|
||||
|
||||
pccnt = sysreg_read(PCCNT);
|
||||
return sprintf(buf, "%lu\n", pccnt);
|
||||
}
|
||||
static ssize_t store_pccycles(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_pccycles(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
@@ -129,14 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev, const char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_pcenable(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_pcenable(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned long pccr;
|
||||
|
||||
pccr = sysreg_read(PCCR);
|
||||
return sprintf(buf, "%c\n", (pccr & 1)?'1':'0');
|
||||
}
|
||||
static ssize_t store_pcenable(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_pcenable(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
unsigned long pccr, val;
|
||||
|
||||
@@ -55,7 +55,8 @@ static u64 resources[NR_CPUS];
|
||||
|
||||
#define show(name) \
|
||||
static ssize_t \
|
||||
show_##name(struct sys_device *dev, char *buf) \
|
||||
show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
char *buf) \
|
||||
{ \
|
||||
u32 cpu=dev->id; \
|
||||
return sprintf(buf, "%lx\n", name[cpu]); \
|
||||
@@ -63,7 +64,8 @@ show_##name(struct sys_device *dev, char *buf) \
|
||||
|
||||
#define store(name) \
|
||||
static ssize_t \
|
||||
store_##name(struct sys_device *dev, const char *buf, size_t size) \
|
||||
store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
const char *buf, size_t size) \
|
||||
{ \
|
||||
unsigned int cpu=dev->id; \
|
||||
name[cpu] = simple_strtoull(buf, NULL, 16); \
|
||||
@@ -76,7 +78,8 @@ show(call_start)
|
||||
* processor. The cpu number in driver is only used for storing data.
|
||||
*/
|
||||
static ssize_t
|
||||
store_call_start(struct sys_device *dev, const char *buf, size_t size)
|
||||
store_call_start(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
unsigned long call_start = simple_strtoull(buf, NULL, 16);
|
||||
@@ -124,14 +127,16 @@ show(err_type_info)
|
||||
store(err_type_info)
|
||||
|
||||
static ssize_t
|
||||
show_virtual_to_phys(struct sys_device *dev, char *buf)
|
||||
show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
return sprintf(buf, "%lx\n", phys_addr[cpu]);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
store_virtual_to_phys(struct sys_device *dev, const char *buf, size_t size)
|
||||
store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
u64 virt_addr=simple_strtoull(buf, NULL, 16);
|
||||
@@ -154,7 +159,8 @@ show(err_struct_info)
|
||||
store(err_struct_info)
|
||||
|
||||
static ssize_t
|
||||
show_err_data_buffer(struct sys_device *dev, char *buf)
|
||||
show_err_data_buffer(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
|
||||
@@ -165,7 +171,9 @@ show_err_data_buffer(struct sys_device *dev, char *buf)
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
store_err_data_buffer(struct sys_device *dev, const char *buf, size_t size)
|
||||
store_err_data_buffer(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
unsigned int cpu=dev->id;
|
||||
int ret;
|
||||
|
||||
@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void)
|
||||
atomic_set(&channel_wqs[i].in_open, 0);
|
||||
mutex_init(&channel_wqs[i].mutex);
|
||||
|
||||
dev = device_create(mt_class, NULL, MKDEV(major, i),
|
||||
"%s%d", module_name, i);
|
||||
dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i),
|
||||
NULL, "%s%d", module_name, i);
|
||||
if (IS_ERR(dev)) {
|
||||
err = PTR_ERR(dev);
|
||||
goto out_chrdev;
|
||||
|
||||
@@ -576,7 +576,8 @@ static int __init sbprof_tb_init(void)
|
||||
|
||||
tb_class = tbc;
|
||||
|
||||
dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), "tb");
|
||||
dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0),
|
||||
NULL, "tb");
|
||||
if (IS_ERR(dev)) {
|
||||
err = PTR_ERR(dev);
|
||||
goto out_class;
|
||||
|
||||
@@ -28,7 +28,9 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||
/* Time in microseconds we delay before sleeping in the idle loop */
|
||||
DEFINE_PER_CPU(unsigned long, smt_snooze_delay) = { 100 };
|
||||
|
||||
static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf,
|
||||
static ssize_t store_smt_snooze_delay(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
|
||||
@@ -44,7 +46,9 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t show_smt_snooze_delay(struct sys_device *dev, char *buf)
|
||||
static ssize_t show_smt_snooze_delay(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
|
||||
|
||||
@@ -152,14 +156,17 @@ static unsigned long write_##NAME(unsigned long val) \
|
||||
mtspr(ADDRESS, val); \
|
||||
return 0; \
|
||||
} \
|
||||
static ssize_t show_##NAME(struct sys_device *dev, char *buf) \
|
||||
static ssize_t show_##NAME(struct sys_device *dev, \
|
||||
struct sysdev_attribute *attr, \
|
||||
char *buf) \
|
||||
{ \
|
||||
struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
|
||||
unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \
|
||||
return sprintf(buf, "%lx\n", val); \
|
||||
} \
|
||||
static ssize_t __used \
|
||||
store_##NAME(struct sys_device *dev, const char *buf, size_t count) \
|
||||
store_##NAME(struct sys_device *dev, struct sysdev_attribute *attr, \
|
||||
const char *buf, size_t count) \
|
||||
{ \
|
||||
struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
|
||||
unsigned long val; \
|
||||
|
||||
@@ -97,7 +97,8 @@ static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iom
|
||||
return value.spe[spu->spe_id];
|
||||
}
|
||||
|
||||
static ssize_t spu_show_temp(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
u8 value;
|
||||
struct cbe_pmd_regs __iomem *pmd_regs;
|
||||
@@ -146,32 +147,38 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char
|
||||
return size;
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_end(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t spu_show_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 0);
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t spu_show_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 8);
|
||||
}
|
||||
|
||||
static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(get_pmd_regs(sysdev), buf, 16);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_end(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 0);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 8);
|
||||
}
|
||||
|
||||
static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(get_pmd_regs(sysdev), buf, size, 16);
|
||||
}
|
||||
@@ -192,43 +199,51 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos)
|
||||
|
||||
/* shows the temperature of the DTS on the PPE,
|
||||
* located near the linear thermal sensor */
|
||||
static ssize_t ppe_show_temp0(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t ppe_show_temp0(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return ppe_show_temp(sysdev, buf, 32);
|
||||
}
|
||||
|
||||
/* shows the temperature of the second DTS on the PPE */
|
||||
static ssize_t ppe_show_temp1(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t ppe_show_temp1(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return ppe_show_temp(sysdev, buf, 0);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t ppe_show_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40);
|
||||
}
|
||||
|
||||
static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, char *buf)
|
||||
static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, char *buf)
|
||||
{
|
||||
return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_end(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40);
|
||||
}
|
||||
|
||||
static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, const char *buf, size_t size)
|
||||
static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev,
|
||||
struct sysdev_attribute *attr, const char *buf, size_t size)
|
||||
{
|
||||
return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48);
|
||||
}
|
||||
|
||||
Loaded 20 of 173 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user