]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ps3: Add passthru support for non-audio streams
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Oct 2008 06:05:10 +0000 (08:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Oct 2008 06:05:15 +0000 (08:05 +0200)
Add support for the channel status bit setting so that non-PCM
data stream can be sent (i.e. pass-through) via SPDIF/HDMI.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
arch/powerpc/include/asm/ps3av.h
drivers/ps3/ps3av_cmd.c

index d30bde2b11ef6f785496b973af97babe84068ba4..5aa22cffdbd658d02c616ba822e3071ac642e3ac 100644 (file)
@@ -678,6 +678,8 @@ struct ps3av_pkt_avb_param {
        u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE];
 };
 
+/* channel status */
+extern u8 ps3av_mode_cs_info[];
 
 /** command status **/
 #define PS3AV_STATUS_SUCCESS                   0x0000  /* success */
index 7f880c26122f36a11b7390a14587693f10898229..11eb50318fec9ce093e6b9ef99e6fd858c4ead20 100644 (file)
@@ -660,9 +660,10 @@ u32 ps3av_cmd_set_av_audio_param(void *p, u32 port,
 }
 
 /* default cs val */
-static const u8 ps3av_mode_cs_info[] = {
+u8 ps3av_mode_cs_info[] = {
        0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00
 };
+EXPORT_SYMBOL_GPL(ps3av_mode_cs_info);
 
 #define CS_44  0x00
 #define CS_48  0x02
@@ -677,7 +678,7 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport,
                              u32 ch, u32 fs, u32 word_bits, u32 format,
                              u32 source)
 {
-       int spdif_through, spdif_bitstream;
+       int spdif_through;
        int i;
 
        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,
                format = PS3AV_CMD_AUDIO_FORMAT_PCM;
                source = PS3AV_CMD_AUDIO_SOURCE_SERIAL;
        }
-       spdif_through = spdif_bitstream = 0;    /* XXX not supported */
 
        /* audio mode */
        memset(audio, 0, sizeof(*audio));
@@ -777,16 +777,17 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport,
                break;
        }
 
+       /* non-audio bit */
+       spdif_through = audio->audio_cs_info[0] & 0x02;
+
        /* pass through setting */
        if (spdif_through &&
            (avport == PS3AV_CMD_AVPORT_SPDIF_0 ||
-            avport == PS3AV_CMD_AVPORT_SPDIF_1)) {
+            avport == PS3AV_CMD_AVPORT_SPDIF_1 ||
+            avport == PS3AV_CMD_AVPORT_HDMI_0 ||
+            avport == PS3AV_CMD_AVPORT_HDMI_1)) {
                audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16;
-               audio->audio_source = PS3AV_CMD_AUDIO_SOURCE_SPDIF;
-               if (spdif_bitstream) {
-                       audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM;
-                       audio->audio_cs_info[0] |= CS_BIT;
-               }
+               audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM;
        }
 }