problem with register_hw_with_fixup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

I'm currently developing a ide driver for an embedded ARM device.
The device hardware is somewhat wired, as all IDE access must
be done 16bit, even the control bytes. I therefore need special
access functions.

I do this to register special IN/OUT functions:

-----%<---some code delete for brevity-------------
void empca400_fixup(
    ide_hwif_t *hwif
)
{
    hwif->mmio = 2;
    hwif->OUTB = &empca400_ide_outb;
    hwif->OUTBSYNC = &empca400_ide_outbsync;
    hwif->OUTW = &empca400_ide_outw;
    hwif->OUTSW = &empca400_ide_outsw;
    :
}


static int __init empca400ide_init(void)
{
	:

        memset(&hw, 0, sizeof(hw));

        base = 0x56000000;
        aux  = base + 0x10;

        vbase = (unsigned long) ioremap(base, 0x10);
        vaux  = vbase + 0x20;

        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
                hw.io_ports[i] = (unsigned long)vbase;
                vbase += 4;
        }
        hw.io_ports[IDE_CONTROL_OFFSET] = vaux + (6 * 0x2);
        hw.irq = 20;  /* GPIO3 = IRQ20 */
        hw.dma = NO_DMA;
        hw.chipset = ide_generic;

        ret = ide_register_hw_with_fixup(&hw, &hwif, empca400_fixup);

	:
}
-----------------------------------------------------

However, in probe_hwif_init_with_fixup() I find this sequence:

-----%<-----------------
int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
	probe_hwif(hwif);

	if (fixup)
		fixup(hwif);
-------------------------

fixup() gets called after probe_hwif, hence my special function
pointers will not be installed in time.

Shouldn't probe_hwif_init_with_fixup() call the fixup() first? If
not, what is fixup() good for, and how can I get my function
pointers registered before probe_hwif()?


mfg

--
----------------------
Stefan Althöfer (stefan.althoefer@xxxxxxx)
Janz Automationssysteme AG
  - Automation Intelligence -
Member of the Janz company group
Im Doerener Feld 8
33100 Paderborn - Germany
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux