/* * Generic platform device PATA driver * * Copyright (C) 2006 - 2007 Paul Mundt * * Based on pata_pcmcia: * * Copyright 2005-2006 Red Hat Inc, all rights reserved. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details.
*/ #include <linux/kernel.h> #include <linux/module.h> #include <linux/blkdev.h> #include <scsi/scsi_host.h> #include <linux/ata.h> #include <linux/libata.h> #include <linux/platform_device.h> #include <linux/ata_platform.h>
staticint pio_mask = 1;
module_param(pio_mask, int, 0);
MODULE_PARM_DESC(pio_mask, "PIO modes supported, mode 0 only by default");
/* * Provide our own set_mode() as we don't want to change anything that has * already been configured..
*/ staticint pata_platform_set_mode(struct ata_link *link, struct ata_device **unused)
{ struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) { /* We don't really care */
dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO;
ata_dev_info(dev, "configured for PIO\n");
} return 0;
}
/** * __pata_platform_probe - attach a platform interface * @dev: device * @io_res: Resource representing I/O base * @ctl_res: Resource representing CTL base * @irq_res: Resource representing IRQ and its flags * @ioport_shift: I/O port shift * @__pio_mask: PIO mask * @sht: scsi_host_template to use when registering * @use16bit: Flag to indicate 16-bit IO instead of 32-bit * * Register a platform bus IDE interface. Such interfaces are PIO and we * assume do not support IRQ sharing. * * Platform devices are expected to contain at least 2 resources per port: * * - I/O Base (IORESOURCE_IO or IORESOURCE_MEM) * - CTL Base (IORESOURCE_IO or IORESOURCE_MEM) * * and optionally: * * - IRQ (IORESOURCE_IRQ) * * If the base resources are both mem types, the ioremap() is handled * here. For IORESOURCE_IO, it's assumed that there's no remapping * necessary. * * If no IRQ resource is present, PIO polling mode is used instead.
*/ int __pata_platform_probe(struct device *dev, struct resource *io_res, struct resource *ctl_res, struct resource *irq_res, unsignedint ioport_shift, int __pio_mask, conststruct scsi_host_template *sht, bool use16bit)
{ struct ata_host *host; struct ata_port *ap; unsignedint mmio; int irq = 0; int irq_flags = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.