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
Kirill Smelkov
linux
Commits
12354010
Commit
12354010
authored
Sep 01, 2003
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[video planb] don't hardware pci command/cacheline/latency values,
use the PCI layer instead to provide those for us.
parent
4458d480
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
drivers/media/video/planb.c
drivers/media/video/planb.c
+22
-8
No files found.
drivers/media/video/planb.c
View file @
12354010
...
@@ -2158,6 +2158,7 @@ static int find_planb(void)
...
@@ -2158,6 +2158,7 @@ static int find_planb(void)
unsigned
int
old_base
,
new_base
;
unsigned
int
old_base
,
new_base
;
unsigned
int
irq
;
unsigned
int
irq
;
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
int
rc
;
if
(
_machine
!=
_MACH_Pmac
)
if
(
_machine
!=
_MACH_Pmac
)
return
0
;
return
0
;
...
@@ -2211,18 +2212,25 @@ static int find_planb(void)
...
@@ -2211,18 +2212,25 @@ static int find_planb(void)
pdev
=
pci_find_slot
(
bus
,
dev_fn
);
pdev
=
pci_find_slot
(
bus
,
dev_fn
);
if
(
!
pdev
)
{
if
(
!
pdev
)
{
printk
(
KERN_ERR
"cannot find slot
\n
"
);
printk
(
KERN_ERR
"
planb:
cannot find slot
\n
"
);
/* XXX handle error */
goto
err_out
;
}
}
/* Enable response in memory space, bus mastering,
/* Enable response in memory space, bus mastering,
use memory write and invalidate */
use memory write and invalidate */
pci_write_config_word
(
pdev
,
PCI_COMMAND
,
rc
=
pci_enable_device
(
pdev
);
PCI_COMMAND_MEMORY
|
PCI_COMMAND_MASTER
|
if
(
rc
)
{
PCI_COMMAND_INVALIDATE
);
printk
(
KERN_ERR
"planb: cannot enable PCI device %s
\n
"
,
/* Set PCI Cache line size & latency timer */
pci_name
(
pdev
));
pci_write_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
0x8
);
goto
err_out
;
pci_write_config_byte
(
pdev
,
PCI_LATENCY_TIMER
,
0x40
);
}
rc
=
pci_set_mwi
(
pdev
);
if
(
rc
)
{
printk
(
KERN_ERR
"planb: cannot enable MWI on PCI device %s
\n
"
,
pci_name
(
pdev
));
goto
err_out_disable
;
}
pci_set_master
(
pdev
);
/* Set the new base address */
/* Set the new base address */
pci_write_config_dword
(
pdev
,
confreg
,
new_base
);
pci_write_config_dword
(
pdev
,
confreg
,
new_base
);
...
@@ -2234,6 +2242,12 @@ static int find_planb(void)
...
@@ -2234,6 +2242,12 @@ static int find_planb(void)
pb
->
irq
=
irq
;
pb
->
irq
=
irq
;
return
planb_num
;
return
planb_num
;
err_out_disable:
pci_disable_device
(
pdev
);
err_out:
/* FIXME handle error */
/* comment moved from pci_find_slot, above */
return
0
;
}
}
static
void
release_planb
(
void
)
static
void
release_planb
(
void
)
...
...
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