aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/ps3av.h2
-rw-r--r--drivers/ps3/ps3av_cmd.c19
2 files changed, 12 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/ps3av.h b/arch/powerpc/include/asm/ps3av.h
index d30bde2b11ef..5aa22cffdbd6 100644
--- a/arch/powerpc/include/asm/ps3av.h
+++ b/arch/powerpc/include/asm/ps3av.h
@@ -678,6 +678,8 @@ struct ps3av_pkt_avb_param {
678 u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE]; 678 u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE];
679}; 679};
680 680
681/* channel status */
682extern u8 ps3av_mode_cs_info[];
681 683
682/** command status **/ 684/** command status **/
683#define PS3AV_STATUS_SUCCESS 0x0000 /* success */ 685#define PS3AV_STATUS_SUCCESS 0x0000 /* success */
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c
index 7f880c26122f..11eb50318fec 100644
--- a/drivers/ps3/ps3av_cmd.c
+++ b/drivers/ps3/ps3av_cmd.c
@@ -660,9 +660,10 @@ u32 ps3av_cmd_set_av_audio_param(void *p, u32 port,
660} 660}
661 661
662/* default cs val */ 662/* default cs val */
663static const u8 ps3av_mode_cs_info[] = { 663u8 ps3av_mode_cs_info[] = {
664 0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00 664 0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00
665}; 665};
666EXPORT_SYMBOL_GPL(ps3av_mode_cs_info);
666 667
667#define CS_44 0x00 668#define CS_44 0x00
668#define CS_48 0x02 669#define CS_48 0x02
@@ -677,7 +678,7 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport,
677 u32 ch, u32 fs, u32 word_bits, u32 format, 678 u32 ch, u32 fs, u32 word_bits, u32 format,
678 u32 source) 679 u32 source)
679{ 680{
680 int spdif_through, spdif_bitstream; 681 int spdif_through;
681 int i; 682 int i;
682 683
683 if (!(ch | fs | format | word_bits | source)) { 684 if (!(ch | fs | format | word_bits | source)) {
@@ -687,7 +688,6 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport,
687 format = PS3AV_CMD_AUDIO_FORMAT_PCM; 688 format = PS3AV_CMD_AUDIO_FORMAT_PCM;
688 source = PS3AV_CMD_AUDIO_SOURCE_SERIAL; 689 source = PS3AV_CMD_AUDIO_SOURCE_SERIAL;
689 } 690 }
690 spdif_through = spdif_bitstream = 0; /* XXX not supported */
691 691
692 /* audio mode */ 692 /* audio mode */
693 memset(audio, 0, sizeof(*audio)); 693 memset(audio, 0, sizeof(*audio));
@@ -777,16 +777,17 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport,
777 break; 777 break;
778 } 778 }
779 779
780 /* non-audio bit */
781 spdif_through = audio->audio_cs_info[0] & 0x02;
782
780 /* pass through setting */ 783 /* pass through setting */
781 if (spdif_through && 784 if (spdif_through &&
782 (avport == PS3AV_CMD_AVPORT_SPDIF_0 || 785 (avport == PS3AV_CMD_AVPORT_SPDIF_0 ||
783 avport == PS3AV_CMD_AVPORT_SPDIF_1)) { 786 avport == PS3AV_CMD_AVPORT_SPDIF_1 ||
787 avport == PS3AV_CMD_AVPORT_HDMI_0 ||
788 avport == PS3AV_CMD_AVPORT_HDMI_1)) {
784 audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16; 789 audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16;
785 audio->audio_source = PS3AV_CMD_AUDIO_SOURCE_SPDIF; 790 audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM;
786 if (spdif_bitstream) {
787 audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM;
788 audio->audio_cs_info[0] |= CS_BIT;
789 }
790 } 791 }
791} 792}
792 793