]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ARM64/SND_BCM2835: Port it to arm64.
authorMichael Zoran <mzoran@crowfest.net>
Fri, 13 Jan 2017 03:05:46 +0000 (19:05 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Fri, 17 Mar 2017 15:26:15 +0000 (09:26 -0600)
In the messages sent to VCHIQ, SND_BCM2835 passes a callback
and a context into two 32 bit pointers.  Since this
message is interpreted by the firmware, it can't be easily
changed.  Luckily only one of these fields is actual used,
so on ARM64 only use one of the fields to store the upper
half of the 64 bit callback pointer.

The Kconfig is also changed to allow ARM audio to work for ARM64
as well.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
sound/arm/Kconfig
sound/arm/bcm2835-vchiq.c
sound/arm/vc_vchi_audioserv_defs.h

index 42581e2f65dfedba6207b6a377a1e1b5df4f2e4b..b427dfe35ad0427db74776dfcb43b7573d9e6e7d 100644 (file)
@@ -2,7 +2,7 @@
 
 menuconfig SND_ARM
        bool "ARM sound devices"
-       depends on ARM
+       depends on (ARM || ARM64)
        default y
        help
          Support for sound devices specific to ARM architectures.
index 7ee436ca9fa2903d41d1bdd8f8f0774025d22ae0..246ae501b7d98498964b41f355ad65046a6ae893 100755 (executable)
@@ -226,7 +226,13 @@ static void audio_vchi_callback(void *param,
                complete(&instance->msg_avail_comp);
        } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
                bcm2835_alsa_stream_t *alsa_stream = instance->alsa_stream;
+#if defined(CONFIG_64BIT)
+               irq_handler_t callback =
+                       (irq_handler_t) (((unsigned long)m.u.complete.callbackl) |
+                       ((unsigned long)m.u.complete.callbackh << 32));
+#else
                irq_handler_t callback = (irq_handler_t) m.u.complete.callback;
+#endif
                LOG_DBG
                    (" .. instance=%p, m.type=VC_AUDIO_MSG_TYPE_COMPLETE, complete=%d\n",
                     instance, m.u.complete.count);
@@ -803,8 +809,13 @@ int bcm2835_audio_write_worker(bcm2835_alsa_stream_t *alsa_stream,
        m.u.write.count = count;
        // old version uses bulk, new version uses control
        m.u.write.max_packet = instance->peer_version < 2 || force_bulk ? 0:4000;
+#if defined(CONFIG_64BIT)
+       m.u.write.callbackl = (uint32_t)(((unsigned long)alsa_stream->fifo_irq_handler)&0xFFFFFFFF);
+       m.u.write.callbackh = (uint32_t)((((unsigned long)alsa_stream->fifo_irq_handler) >> 32)&0xFFFFFFFF);
+#else
        m.u.write.callback = alsa_stream->fifo_irq_handler;
        m.u.write.cookie = alsa_stream;
+#endif
        m.u.write.silence = src == NULL;
 
        /* Send the message to the videocore */
index af3e6eb690113fc32ce9e06bd2f0f294da7a7f00..ede6154bc09d38469a82008174d0e35749fd9932 100644 (file)
@@ -78,8 +78,13 @@ typedef struct {
 // configure the write audio samples
 typedef struct {
        uint32_t count;         // in bytes
+#if defined(CONFIG_64BIT)
+       uint32_t callbackl;
+       uint32_t callbackh;
+#else
        void *callback;
        void *cookie;
+#endif
        uint16_t silence;
        uint16_t max_packet;
 } VC_AUDIO_WRITE_T;
@@ -93,8 +98,13 @@ typedef struct {
 // Generic result for a request (VC->HOST)
 typedef struct {
        int32_t count;          // Success value
+#if defined(CONFIG_64BIT)
+       uint32_t callbackl;
+       uint32_t callbackh;
+#else
        void *callback;
        void *cookie;
+#endif
 } VC_AUDIO_COMPLETE_T;
 
 // Message header for all messages in HOST->VC direction