.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * pata-legacy.c - Legacy port PATA/SATA controller driver. |
---|
3 | 4 | * Copyright 2005/2006 Red Hat, all rights reserved. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation; either version 2, or (at your option) |
---|
8 | | - * any later version. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | | - * |
---|
15 | | - * You should have received a copy of the GNU General Public License |
---|
16 | | - * along with this program; see the file COPYING. If not, write to |
---|
17 | | - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
18 | 5 | * |
---|
19 | 6 | * An ATA driver for the legacy ATA ports. |
---|
20 | 7 | * |
---|
.. | .. |
---|
55 | 42 | * |
---|
56 | 43 | * For now use autospeed and pio_mask as above with the W83759A. This may |
---|
57 | 44 | * change. |
---|
58 | | - * |
---|
59 | 45 | */ |
---|
60 | 46 | |
---|
61 | 47 | #include <linux/async.h> |
---|
.. | .. |
---|
292 | 278 | outb(inb(0x1F4) & 0x07, 0x1F4); |
---|
293 | 279 | |
---|
294 | 280 | rt = inb(0x1F3); |
---|
295 | | - rt &= 0x07 << (3 * adev->devno); |
---|
| 281 | + rt &= ~(0x07 << (3 * !adev->devno)); |
---|
296 | 282 | if (pio) |
---|
297 | | - rt |= (1 + 3 * pio) << (3 * adev->devno); |
---|
| 283 | + rt |= (1 + 3 * pio) << (3 * !adev->devno); |
---|
| 284 | + outb(rt, 0x1F3); |
---|
298 | 285 | |
---|
299 | 286 | udelay(100); |
---|
300 | 287 | outb(inb(0x1F2) | 0x01, 0x1F2); |
---|