Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
60e57ed7
Commit
60e57ed7
authored
Jul 24, 2008
by
Bartlomiej Zolnierkiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aec62xx: convert to use ->host_priv
Signed-off-by:
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
parent
08da591e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
drivers/ide/pci/aec62xx.c
drivers/ide/pci/aec62xx.c
+16
-16
No files found.
drivers/ide/pci/aec62xx.c
View file @
60e57ed7
...
...
@@ -59,10 +59,6 @@ static const struct chipset_bus_clock_list_entry aec6xxx_34_base [] = {
{
0
,
0x00
,
0x00
}
};
#define BUSCLOCK(D) \
((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D)))
/*
* TO DO: active tuning and correction of cards without a bios.
*/
...
...
@@ -88,6 +84,8 @@ static void aec6210_set_mode(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
struct
pci_dev
*
dev
=
to_pci_dev
(
hwif
->
dev
);
struct
ide_host
*
host
=
pci_get_drvdata
(
dev
);
struct
chipset_bus_clock_list_entry
*
bus_clock
=
host
->
host_priv
;
u16
d_conf
=
0
;
u8
ultra
=
0
,
ultra_conf
=
0
;
u8
tmp0
=
0
,
tmp1
=
0
,
tmp2
=
0
;
...
...
@@ -96,7 +94,7 @@ static void aec6210_set_mode(ide_drive_t *drive, const u8 speed)
local_irq_save
(
flags
);
/* 0x40|(2*drive->dn): Active, 0x41|(2*drive->dn): Recovery */
pci_read_config_word
(
dev
,
0x40
|
(
2
*
drive
->
dn
),
&
d_conf
);
tmp0
=
pci_bus_clock_list
(
speed
,
BUSCLOCK
(
dev
)
);
tmp0
=
pci_bus_clock_list
(
speed
,
bus_clock
);
d_conf
=
((
tmp0
&
0xf0
)
<<
4
)
|
(
tmp0
&
0xf
);
pci_write_config_word
(
dev
,
0x40
|
(
2
*
drive
->
dn
),
d_conf
);
...
...
@@ -104,7 +102,7 @@ static void aec6210_set_mode(ide_drive_t *drive, const u8 speed)
tmp2
=
0x00
;
pci_read_config_byte
(
dev
,
0x54
,
&
ultra
);
tmp1
=
((
0x00
<<
(
2
*
drive
->
dn
))
|
(
ultra
&
~
(
3
<<
(
2
*
drive
->
dn
))));
ultra_conf
=
pci_bus_clock_list_ultra
(
speed
,
BUSCLOCK
(
dev
)
);
ultra_conf
=
pci_bus_clock_list_ultra
(
speed
,
bus_clock
);
tmp2
=
((
ultra_conf
<<
(
2
*
drive
->
dn
))
|
(
tmp1
&
~
(
3
<<
(
2
*
drive
->
dn
))));
pci_write_config_byte
(
dev
,
0x54
,
tmp2
);
local_irq_restore
(
flags
);
...
...
@@ -114,6 +112,8 @@ static void aec6260_set_mode(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
struct
pci_dev
*
dev
=
to_pci_dev
(
hwif
->
dev
);
struct
ide_host
*
host
=
pci_get_drvdata
(
dev
);
struct
chipset_bus_clock_list_entry
*
bus_clock
=
host
->
host_priv
;
u8
unit
=
(
drive
->
select
.
b
.
unit
&
0x01
);
u8
tmp1
=
0
,
tmp2
=
0
;
u8
ultra
=
0
,
drive_conf
=
0
,
ultra_conf
=
0
;
...
...
@@ -122,12 +122,12 @@ static void aec6260_set_mode(ide_drive_t *drive, const u8 speed)
local_irq_save
(
flags
);
/* high 4-bits: Active, low 4-bits: Recovery */
pci_read_config_byte
(
dev
,
0x40
|
drive
->
dn
,
&
drive_conf
);
drive_conf
=
pci_bus_clock_list
(
speed
,
BUSCLOCK
(
dev
)
);
drive_conf
=
pci_bus_clock_list
(
speed
,
bus_clock
);
pci_write_config_byte
(
dev
,
0x40
|
drive
->
dn
,
drive_conf
);
pci_read_config_byte
(
dev
,
(
0x44
|
hwif
->
channel
),
&
ultra
);
tmp1
=
((
0x00
<<
(
4
*
unit
))
|
(
ultra
&
~
(
7
<<
(
4
*
unit
))));
ultra_conf
=
pci_bus_clock_list_ultra
(
speed
,
BUSCLOCK
(
dev
)
);
ultra_conf
=
pci_bus_clock_list_ultra
(
speed
,
bus_clock
);
tmp2
=
((
ultra_conf
<<
(
4
*
unit
))
|
(
tmp1
&
~
(
7
<<
(
4
*
unit
))));
pci_write_config_byte
(
dev
,
(
0x44
|
hwif
->
channel
),
tmp2
);
local_irq_restore
(
flags
);
...
...
@@ -140,13 +140,6 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
static
unsigned
int
__devinit
init_chipset_aec62xx
(
struct
pci_dev
*
dev
,
const
char
*
name
)
{
int
bus_speed
=
ide_pci_clk
?
ide_pci_clk
:
33
;
if
(
bus_speed
<=
33
)
pci_set_drvdata
(
dev
,
(
void
*
)
aec6xxx_33_base
);
else
pci_set_drvdata
(
dev
,
(
void
*
)
aec6xxx_34_base
);
/* These are necessary to get AEC6280 Macintosh cards to work */
if
((
dev
->
device
==
PCI_DEVICE_ID_ARTOP_ATP865
)
||
(
dev
->
device
==
PCI_DEVICE_ID_ARTOP_ATP865R
))
{
...
...
@@ -254,10 +247,17 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
static
int
__devinit
aec62xx_init_one
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
const
struct
chipset_bus_clock_list_entry
*
bus_clock
;
struct
ide_port_info
d
;
u8
idx
=
id
->
driver_data
;
int
bus_speed
=
ide_pci_clk
?
ide_pci_clk
:
33
;
int
err
;
if
(
bus_speed
<=
33
)
bus_clock
=
aec6xxx_33_base
;
else
bus_clock
=
aec6xxx_34_base
;
err
=
pci_enable_device
(
dev
);
if
(
err
)
return
err
;
...
...
@@ -273,7 +273,7 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
}
}
err
=
ide_pci_init_one
(
dev
,
&
d
,
NULL
);
err
=
ide_pci_init_one
(
dev
,
&
d
,
(
void
*
)
bus_clock
);
if
(
err
)
pci_disable_device
(
dev
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment