Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91490
b: refs/heads/master
c: b163a25
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Paul Mackerras committed Apr 1, 2008
1 parent a394b3d commit c69f220
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa90f70a8ed338d1afb43da21163752c6558a7d5
refs/heads/master: b163a256dac8ceb01d40bebe25c315768cf1877b
78 changes: 46 additions & 32 deletions trunk/arch/powerpc/platforms/ps3/device-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,41 +499,14 @@ static int __init ps3_register_graphics_devices(void)
}

/**
* ps3_register_repository_device - Register a device from the repositiory info.
*
* ps3_setup_dynamic_device - Setup a dynamic device from the repository
*/

static int ps3_register_repository_device(
const struct ps3_repository_device *repo)
static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo)
{
int result;

switch (repo->dev_type) {
case PS3_DEV_TYPE_SB_GELIC:
result = ps3_setup_gelic_device(repo);
if (result) {
pr_debug("%s:%d ps3_setup_gelic_device failed\n",
__func__, __LINE__);
}
break;
case PS3_DEV_TYPE_SB_USB:

/* Each USB device has both an EHCI and an OHCI HC */

result = ps3_setup_ehci_device(repo);

if (result) {
pr_debug("%s:%d ps3_setup_ehci_device failed\n",
__func__, __LINE__);
}

result = ps3_setup_ohci_device(repo);

if (result) {
pr_debug("%s:%d ps3_setup_ohci_device failed\n",
__func__, __LINE__);
}
break;
case PS3_DEV_TYPE_STOR_DISK:
result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK);

Expand Down Expand Up @@ -572,6 +545,48 @@ static int ps3_register_repository_device(
return result;
}

/**
* ps3_setup_static_device - Setup a static device from the repository
*/

static int __init ps3_setup_static_device(const struct ps3_repository_device *repo)
{
int result;

switch (repo->dev_type) {
case PS3_DEV_TYPE_SB_GELIC:
result = ps3_setup_gelic_device(repo);
if (result) {
pr_debug("%s:%d ps3_setup_gelic_device failed\n",
__func__, __LINE__);
}
break;
case PS3_DEV_TYPE_SB_USB:

/* Each USB device has both an EHCI and an OHCI HC */

result = ps3_setup_ehci_device(repo);

if (result) {
pr_debug("%s:%d ps3_setup_ehci_device failed\n",
__func__, __LINE__);
}

result = ps3_setup_ohci_device(repo);

if (result) {
pr_debug("%s:%d ps3_setup_ohci_device failed\n",
__func__, __LINE__);
}
break;

default:
return ps3_setup_dynamic_device(repo);
}

return result;
}

static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
{
struct ps3_repository_device repo;
Expand Down Expand Up @@ -601,7 +616,7 @@ static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
__func__, __LINE__, bus_id, dev_id, retries);

ps3_register_repository_device(&repo);
ps3_setup_dynamic_device(&repo);
return;
}

Expand Down Expand Up @@ -905,8 +920,7 @@ static int __init ps3_register_devices(void)

ps3_register_graphics_devices();

ps3_repository_find_devices(PS3_BUS_TYPE_SB,
ps3_register_repository_device);
ps3_repository_find_devices(PS3_BUS_TYPE_SB, ps3_setup_static_device);

ps3_register_sound_devices();

Expand Down

0 comments on commit c69f220

Please sign in to comment.