diff options
Diffstat (limited to 'drivers/ps3')
-rw-r--r-- | drivers/ps3/ps3av.c | 9 | ||||
-rw-r--r-- | drivers/ps3/ps3av_cmd.c | 24 | ||||
-rw-r--r-- | drivers/ps3/sys-manager.c | 6 | ||||
-rw-r--r-- | drivers/ps3/vuart.c | 6 |
4 files changed, 30 insertions, 15 deletions
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 1926b4d3e1f4..d21e04ccb021 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | |||
28 | #include <asm/firmware.h> | ||
27 | #include <asm/lv1call.h> | 29 | #include <asm/lv1call.h> |
28 | #include <asm/ps3av.h> | 30 | #include <asm/ps3av.h> |
29 | #include <asm/ps3.h> | 31 | #include <asm/ps3.h> |
@@ -947,7 +949,12 @@ static struct ps3_vuart_port_driver ps3av_driver = { | |||
947 | 949 | ||
948 | static int ps3av_module_init(void) | 950 | static int ps3av_module_init(void) |
949 | { | 951 | { |
950 | int error = ps3_vuart_port_driver_register(&ps3av_driver); | 952 | int error; |
953 | |||
954 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
955 | return -ENODEV; | ||
956 | |||
957 | error = ps3_vuart_port_driver_register(&ps3av_driver); | ||
951 | if (error) { | 958 | if (error) { |
952 | printk(KERN_ERR | 959 | printk(KERN_ERR |
953 | "%s: ps3_vuart_port_driver_register failed %d\n", | 960 | "%s: ps3_vuart_port_driver_register failed %d\n", |
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index 21c97c80aa2e..bc70e81f8cb0 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c | |||
@@ -485,12 +485,12 @@ static u8 ps3av_cnv_mclk(u32 fs) | |||
485 | 485 | ||
486 | static const u32 ps3av_ns_table[][5] = { | 486 | static const u32 ps3av_ns_table[][5] = { |
487 | /* D1, D2, D3, D4, D5 */ | 487 | /* D1, D2, D3, D4, D5 */ |
488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] { 6272, 6272, 17836, 17836, 8918 }, | 488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] = { 6272, 6272, 17836, 17836, 8918 }, |
489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] { 6144, 6144, 11648, 11648, 5824 }, | 489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] = { 6144, 6144, 11648, 11648, 5824 }, |
490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] { 12544, 12544, 35672, 35672, 17836 }, | 490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] = { 12544, 12544, 35672, 35672, 17836 }, |
491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] { 12288, 12288, 23296, 23296, 11648 }, | 491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] = { 12288, 12288, 23296, 23296, 11648 }, |
492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] { 25088, 25088, 71344, 71344, 35672 }, | 492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] = { 25088, 25088, 71344, 71344, 35672 }, |
493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] { 24576, 24576, 46592, 46592, 23296 } | 493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] = { 24576, 24576, 46592, 46592, 23296 } |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | 496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) |
@@ -543,9 +543,10 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | |||
543 | 543 | ||
544 | #undef BASE | 544 | #undef BASE |
545 | 545 | ||
546 | static u8 ps3av_cnv_enable(u32 source, u8 *enable) | 546 | static u8 ps3av_cnv_enable(u32 source, const u8 *enable) |
547 | { | 547 | { |
548 | u8 *p, ret = 0; | 548 | const u8 *p; |
549 | u8 ret = 0; | ||
549 | 550 | ||
550 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { | 551 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { |
551 | ret = 0x03; | 552 | ret = 0x03; |
@@ -559,9 +560,10 @@ static u8 ps3av_cnv_enable(u32 source, u8 *enable) | |||
559 | return ret; | 560 | return ret; |
560 | } | 561 | } |
561 | 562 | ||
562 | static u8 ps3av_cnv_fifomap(u8 *map) | 563 | static u8 ps3av_cnv_fifomap(const u8 *map) |
563 | { | 564 | { |
564 | u8 *p, ret = 0; | 565 | const u8 *p; |
566 | u8 ret = 0; | ||
565 | 567 | ||
566 | p = map; | 568 | p = map; |
567 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); | 569 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); |
@@ -615,7 +617,7 @@ static void ps3av_cnv_info(struct ps3av_audio_info_frame *info, | |||
615 | info->pb5.lsv = mode->audio_downmix_level; | 617 | info->pb5.lsv = mode->audio_downmix_level; |
616 | } | 618 | } |
617 | 619 | ||
618 | static void ps3av_cnv_chstat(u8 *chstat, u8 *cs_info) | 620 | static void ps3av_cnv_chstat(u8 *chstat, const u8 *cs_info) |
619 | { | 621 | { |
620 | memcpy(chstat, cs_info, 5); | 622 | memcpy(chstat, cs_info, 5); |
621 | } | 623 | } |
diff --git a/drivers/ps3/sys-manager.c b/drivers/ps3/sys-manager.c index 0fc30be8b81e..3aa2b0dcc369 100644 --- a/drivers/ps3/sys-manager.c +++ b/drivers/ps3/sys-manager.c | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | |||
26 | #include <asm/firmware.h> | ||
25 | #include <asm/ps3.h> | 27 | #include <asm/ps3.h> |
28 | |||
26 | #include "vuart.h" | 29 | #include "vuart.h" |
27 | 30 | ||
28 | MODULE_AUTHOR("Sony Corporation"); | 31 | MODULE_AUTHOR("Sony Corporation"); |
@@ -598,6 +601,9 @@ static struct ps3_vuart_port_driver ps3_sys_manager = { | |||
598 | 601 | ||
599 | static int __init ps3_sys_manager_init(void) | 602 | static int __init ps3_sys_manager_init(void) |
600 | { | 603 | { |
604 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
605 | return -ENODEV; | ||
606 | |||
601 | return ps3_vuart_port_driver_register(&ps3_sys_manager); | 607 | return ps3_vuart_port_driver_register(&ps3_sys_manager); |
602 | } | 608 | } |
603 | 609 | ||
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index 746298107d6f..6c12744eeb9d 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c | |||
@@ -952,7 +952,7 @@ fail_alloc_irq: | |||
952 | kfree(dev->priv); | 952 | kfree(dev->priv); |
953 | dev->priv = NULL; | 953 | dev->priv = NULL; |
954 | fail_alloc: | 954 | fail_alloc: |
955 | vuart_bus_priv.devices[port_number] = 0; | 955 | vuart_bus_priv.devices[port_number] = NULL; |
956 | fail_match: | 956 | fail_match: |
957 | up(&vuart_bus_priv.probe_mutex); | 957 | up(&vuart_bus_priv.probe_mutex); |
958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); | 958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); |
@@ -978,7 +978,7 @@ static int ps3_vuart_remove(struct device *_dev) | |||
978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, | 978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, |
979 | __LINE__, dev->core.bus_id); | 979 | __LINE__, dev->core.bus_id); |
980 | 980 | ||
981 | vuart_bus_priv.devices[dev->priv->port_number] = 0; | 981 | vuart_bus_priv.devices[dev->priv->port_number] = NULL; |
982 | 982 | ||
983 | if (--vuart_bus_priv.use_count == 0) { | 983 | if (--vuart_bus_priv.use_count == 0) { |
984 | BUG(); | 984 | BUG(); |
@@ -1031,7 +1031,7 @@ int __init ps3_vuart_bus_init(void) | |||
1031 | pr_debug("%s:%d:\n", __func__, __LINE__); | 1031 | pr_debug("%s:%d:\n", __func__, __LINE__); |
1032 | 1032 | ||
1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | 1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) |
1034 | return 0; | 1034 | return -ENODEV; |
1035 | 1035 | ||
1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); | 1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); |
1037 | result = bus_register(&ps3_vuart_bus); | 1037 | result = bus_register(&ps3_vuart_bus); |