| .. | .. |
|---|
| 47 | 47 | ATA_PIO_SHT(DRV_NAME), |
|---|
| 48 | 48 | }; |
|---|
| 49 | 49 | |
|---|
| 50 | | -static struct ata_port_operations pata_platform_port_ops = { |
|---|
| 51 | | - .inherits = &ata_sff_port_ops, |
|---|
| 52 | | - .sff_data_xfer = ata_sff_data_xfer32, |
|---|
| 53 | | - .cable_detect = ata_cable_unknown, |
|---|
| 54 | | - .set_mode = pata_platform_set_mode, |
|---|
| 55 | | -}; |
|---|
| 56 | | - |
|---|
| 57 | 50 | static void pata_platform_setup_port(struct ata_ioports *ioaddr, |
|---|
| 58 | 51 | unsigned int shift) |
|---|
| 59 | 52 | { |
|---|
| .. | .. |
|---|
| 79 | 72 | * @ioport_shift: I/O port shift |
|---|
| 80 | 73 | * @__pio_mask: PIO mask |
|---|
| 81 | 74 | * @sht: scsi_host_template to use when registering |
|---|
| 75 | + * @use16bit: Flag to indicate 16-bit IO instead of 32-bit |
|---|
| 82 | 76 | * |
|---|
| 83 | 77 | * Register a platform bus IDE interface. Such interfaces are PIO and we |
|---|
| 84 | 78 | * assume do not support IRQ sharing. |
|---|
| .. | .. |
|---|
| 101 | 95 | int __pata_platform_probe(struct device *dev, struct resource *io_res, |
|---|
| 102 | 96 | struct resource *ctl_res, struct resource *irq_res, |
|---|
| 103 | 97 | unsigned int ioport_shift, int __pio_mask, |
|---|
| 104 | | - struct scsi_host_template *sht) |
|---|
| 98 | + struct scsi_host_template *sht, bool use16bit) |
|---|
| 105 | 99 | { |
|---|
| 106 | 100 | struct ata_host *host; |
|---|
| 107 | 101 | struct ata_port *ap; |
|---|
| .. | .. |
|---|
| 120 | 114 | */ |
|---|
| 121 | 115 | if (irq_res && irq_res->start > 0) { |
|---|
| 122 | 116 | irq = irq_res->start; |
|---|
| 123 | | - irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; |
|---|
| 117 | + irq_flags = (irq_res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED; |
|---|
| 124 | 118 | } |
|---|
| 125 | 119 | |
|---|
| 126 | 120 | /* |
|---|
| .. | .. |
|---|
| 131 | 125 | return -ENOMEM; |
|---|
| 132 | 126 | ap = host->ports[0]; |
|---|
| 133 | 127 | |
|---|
| 134 | | - ap->ops = &pata_platform_port_ops; |
|---|
| 128 | + ap->ops = devm_kzalloc(dev, sizeof(*ap->ops), GFP_KERNEL); |
|---|
| 129 | + ap->ops->inherits = &ata_sff_port_ops; |
|---|
| 130 | + ap->ops->cable_detect = ata_cable_unknown; |
|---|
| 131 | + ap->ops->set_mode = pata_platform_set_mode; |
|---|
| 132 | + if (use16bit) |
|---|
| 133 | + ap->ops->sff_data_xfer = ata_sff_data_xfer; |
|---|
| 134 | + else |
|---|
| 135 | + ap->ops->sff_data_xfer = ata_sff_data_xfer32; |
|---|
| 136 | + |
|---|
| 135 | 137 | ap->pio_mask = __pio_mask; |
|---|
| 136 | 138 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
|---|
| 137 | 139 | |
|---|
| .. | .. |
|---|
| 218 | 220 | |
|---|
| 219 | 221 | return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res, |
|---|
| 220 | 222 | pp_info ? pp_info->ioport_shift : 0, |
|---|
| 221 | | - pio_mask, &pata_platform_sht); |
|---|
| 223 | + pio_mask, &pata_platform_sht, false); |
|---|
| 222 | 224 | } |
|---|
| 223 | 225 | |
|---|
| 224 | 226 | static struct platform_driver pata_platform_driver = { |
|---|