#ifndef __ASM_SPARC64_FLOPPY_H
#define __ASM_SPARC64_FLOPPY_H
+#include <linux/config.h>
#include <linux/init.h>
#include <asm/page.h>
pdma_areasize = pdma_size;
}
-irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
-{
- if (likely(doing_pdma)) {
- void __iomem *stat = (void __iomem *) fdc_status;
- unsigned char *vaddr = pdma_vaddr;
- unsigned long size = pdma_size;
- u8 val;
-
- while (size) {
- val = readb(stat);
- if (unlikely(!(val & 0x80))) {
- pdma_vaddr = vaddr;
- pdma_size = size;
- return IRQ_HANDLED;
- }
- if (unlikely(!(val & 0x20))) {
- pdma_vaddr = vaddr;
- pdma_size = size;
- doing_pdma = 0;
- goto main_interrupt;
- }
- if (val & 0x40) {
- /* read */
- *vaddr++ = readb(stat + 1);
- } else {
- unsigned char data = *vaddr++;
-
- /* write */
- writeb(data, stat + 1);
- }
- size--;
- }
-
- pdma_vaddr = vaddr;
- pdma_size = size;
-
- /* Send Terminal Count pulse to floppy controller. */
- val = readb(auxio_register);
- val |= AUXIO_AUX1_FTCNT;
- writeb(val, auxio_register);
- val &= ~AUXIO_AUX1_FTCNT;
- writeb(val, auxio_register);
-
- doing_pdma = 0;
- }
-
-main_interrupt:
- return floppy_interrupt(irq, dev_cookie, regs);
-}
+extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *);
static int sun_fd_request_irq(void)
{
once = 1;
error = request_irq(FLOPPY_IRQ, sparc_floppy_irq,
- IRQF_DISABLED, "floppy", NULL);
+ SA_INTERRUPT, "floppy", NULL);
return ((error == 0) ? 0 : -1);
}
#ifdef CONFIG_PCI
static int __init ebus_fdthree_p(struct linux_ebus_device *edev)
{
- if (!strcmp(edev->prom_node->name, "fdthree"))
+ if (!strcmp(edev->prom_name, "fdthree"))
return 1;
- if (!strcmp(edev->prom_node->name, "floppy")) {
- char *compat;
-
- compat = of_get_property(edev->prom_node,
- "compatible", NULL);
- if (compat && !strcmp(compat, "fdthree"))
+ if (!strcmp(edev->prom_name, "floppy")) {
+ char compat[16];
+ prom_getstring(edev->prom_node,
+ "compatible",
+ compat, sizeof(compat));
+ compat[15] = '\0';
+ if (!strcmp(compat, "fdthree"))
return 1;
}
return 0;
for_each_isa(isa_br) {
for_each_isadev(isa_dev, isa_br) {
- if (!strcmp(isa_dev->prom_node->name, "dma")) {
+ if (!strcmp(isa_dev->prom_name, "dma")) {
struct sparc_isa_device *child =
isa_dev->child;
while (child) {
- if (!strcmp(child->prom_node->name,
+ if (!strcmp(child->prom_name,
"floppy")) {
isa_dev = child;
goto isa_done;
struct linux_ebus_device *edev = NULL;
unsigned long config = 0;
void __iomem *auxio_reg;
- char *state_prop;
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
#endif
}
- state_prop = of_get_property(edev->prom_node, "status", NULL);
- if (state_prop && !strncmp(state_prop, "disabled", 8))
+ prom_getproperty(edev->prom_node, "status",
+ state, sizeof(state));
+ if (!strncmp(state, "disabled", 8))
return 0;
FLOPPY_IRQ = edev->irqs[0];
*/
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
- if (!strcmp(edev->prom_node->name, "ecpp")) {
+ if (!strcmp(edev->prom_name, "ecpp")) {
config = edev->resource[1].start;
goto config_done;
}
if (!sun_floppy_types[0] && sun_floppy_types[1]) {
/*
* Set the drive exchange bit in FCR on NS87303,
- * make sure other bits are sane before doing so.
+ * make shure other bits are sane before doing so.
*/
ns87303_modify(config, FER, FER_EDM, 0);
ns87303_modify(config, ASC, ASC_DRV2_SEL, 0);