Skip to content

Commit

Permalink
msm: qdsp6_1550: fix audio and vdec/venc initialization
Browse files Browse the repository at this point in the history
This could also mean that audio is actually working but then again
it might also still not work.

Signed-off-by: marc1706 <admin@m-a-styles.de>
  • Loading branch information
marc1706 committed Feb 7, 2013
1 parent 40201d0 commit 25ac01d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 22 deletions.
17 changes: 9 additions & 8 deletions arch/arm/mach-msm/qdsp6_1550/dal.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ static void dal_channel_notify(void *priv, unsigned event)
static LIST_HEAD(dal_channel_list);
static DEFINE_MUTEX(dal_channel_list_lock);

static struct dal_channel *dal_open_channel(const char *name)
static struct dal_channel *dal_open_channel(const char *name, uint32_t cpu)
{
struct dal_channel *dch;

/* quick sanity check to avoid trying to talk to
* some non-DAL channel...
*/
if (strncmp(name, "DSP_DAL", 7) && strncmp(name, "SMD_DAL", 7))
if (strncmp(name, "DAL", 3) && strncmp(name, "SMD_DAL", 7))
return 0;

mutex_lock(&dal_channel_list_lock);
Expand All @@ -319,7 +319,7 @@ static struct dal_channel *dal_open_channel(const char *name)

found_it:
if (!dch->sch) {
if (smd_open(name, &dch->sch, dch, dal_channel_notify))
if (smd_named_open_on_edge(name, cpu, &dch->sch, dch, dal_channel_notify))
dch = NULL;
/* FIXME: wait for channel to open before returning */
msleep(100);
Expand Down Expand Up @@ -416,8 +416,9 @@ struct dal_reply_attach {
char name[64];
};


struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname, const char *name, dal_event_func_t func, void *cookie)
struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname,
const char *name, uint32_t cpu, dal_event_func_t func,
void *cookie)
{
struct dal_hdr hdr;
struct dal_msg_attach msg;
Expand All @@ -427,7 +428,7 @@ struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname, const ch
unsigned long flags;
int r;

dch = dal_open_channel(name);
dch = dal_open_channel(name, cpu);
if (!dch)
return 0;

Expand Down Expand Up @@ -476,7 +477,7 @@ struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname, const ch


struct dal_client *dal_attach(uint32_t device_id, const char *name,
dal_event_func_t func, void *cookie)
uint32_t cpu, dal_event_func_t func, void *cookie)
{
struct dal_hdr hdr;
struct dal_msg_attach msg;
Expand All @@ -486,7 +487,7 @@ struct dal_client *dal_attach(uint32_t device_id, const char *name,
unsigned long flags;
int r;

dch = dal_open_channel(name);
dch = dal_open_channel(name, cpu);
if (!dch)
return 0;

Expand Down
8 changes: 6 additions & 2 deletions arch/arm/mach-msm/qdsp6_1550/dal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ struct dal_info {

typedef void (*dal_event_func_t)(void *data, int len, void *cookie);

struct dal_client *dal_attach(uint32_t device_id, const char *name, dal_event_func_t func, void *cookie);
struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname, const char *name, dal_event_func_t func, void *cookie);
struct dal_client *dal_attach(uint32_t device_id, const char *name,
uint32_t cpu, dal_event_func_t func,
void *cookie);
struct dal_client *dal_attach_ex(uint32_t device_id, const char *aname,
const char *name, uint32_t cpu,
dal_event_func_t func, void *cookie);

int dal_detach(struct dal_client *client);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/qdsp6_1550/dal_acdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#define ACDB_DAL_DEVICE 0x02000069
//#define ACDB_DAL_PORT "SMD_DAL_AM_AUD"
#define ACDB_DAL_PORT "SMD_DAL00"
#define ACDB_DAL_PORT "DAL00"

#define ACDB_OP_IOCTL DAL_OP_FIRST_DEVICE_API

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/qdsp6_1550/dal_adie.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "dal.h"

#define ADIE_DAL_DEVICE 0x02000029
#define ADIE_DAL_PORT "SMD_DAL00"
#define ADIE_DAL_PORT "DAL00"
//#define ADIE_DAL_PORT "SMD_DAL_AM_AUD"


Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/qdsp6_1550/dal_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <mach/msm_qdsp6_audio_1550.h>

#define AUDIO_DAL_DEVICE 0x02000028
#define AUDIO_DAL_PORT "DSP_DAL_AQ_AUD"
#define AUDIO_DAL_PORT "DAL_AQ_AUD"

enum
{
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/qdsp6_1550/msm_q6vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "dal.h"

#define DALDEVICEID_VDEC_DEVICE 0x02000026
#define DALDEVICEID_VDEC_PORTNAME "DSP_DAL_AQ_VID"
#define DALDEVICEID_VDEC_PORTNAME "DAL_AQ_VID"

#define VDEC_INTERFACE_VERSION 0x00020000

Expand Down Expand Up @@ -838,7 +838,7 @@ static int vdec_open(struct inode *inode, struct file *file)
}

vd->vdec_handle = dal_attach(DALDEVICEID_VDEC_DEVICE,
DALDEVICEID_VDEC_PORTNAME,
DALDEVICEID_VDEC_PORTNAME, 1,
callback, vd);

if (!vd->vdec_handle) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/qdsp6_1550/msm_q6venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "dal.h"

#define DALDEVICEID_VENC_DEVICE 0x0200002D
#define DALDEVICEID_VENC_PORTNAME "DSP_DAL_AQ_VID"
#define DALDEVICEID_VENC_PORTNAME "DAL_AQ_VID"

enum {
VENC_DALRPC_INITIALIZE = DAL_OP_FIRST_DEVICE_API,
Expand Down Expand Up @@ -214,7 +214,7 @@ static int q6venc_open(struct inode *inode, struct file *file)
spin_lock_init(&q6venc->done_lock);

q6venc->venc = dal_attach(DALDEVICEID_VENC_DEVICE,
DALDEVICEID_VENC_PORTNAME,
DALDEVICEID_VENC_PORTNAME, 1,
callback, q6venc);
if (!q6venc->venc) {
pr_err("%s: dal_attach failed\n", __func__);
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-msm/qdsp6_1550/q6audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static struct audio_client *audio_client_alloc(unsigned bufsz)


// dsp = dal_attach(AUDIO_DAL_DEVICE, AUDIO_DAL_PORT, callback, 0);
dsp = dal_attach_ex(AUDIO_DAL_DEVICE, "AudioQdsp", AUDIO_DAL_PORT, callback, 0);
dsp = dal_attach_ex(AUDIO_DAL_DEVICE, "AudioQdsp", AUDIO_DAL_PORT, 1, callback, 0);
if (!dsp)
{
pr_err("audio_client_alloc: cannot attach to adsp\n");
Expand Down Expand Up @@ -1349,7 +1349,7 @@ static int q6audio_init(void)
}

// pr_info("audio: init: attach ACDB\n");
acdb = dal_attach(ACDB_DAL_DEVICE, ACDB_DAL_PORT, 0, 0);
acdb = dal_attach(ACDB_DAL_DEVICE, ACDB_DAL_PORT, 0, 0, 0);
if (!acdb)
{
pr_err("audio_init: cannot attach to acdb channel\n");
Expand All @@ -1358,7 +1358,7 @@ static int q6audio_init(void)
}

// pr_info("audio: init: attach ADIE\n");
adie = dal_attach(ADIE_DAL_DEVICE, ADIE_DAL_PORT, 0, 0);
adie = dal_attach(ADIE_DAL_DEVICE, ADIE_DAL_PORT, 0, 0, 0);
if (!adie) {
pr_err("audio_init: cannot attach to adie\n");
res = -ENODEV;
Expand Down Expand Up @@ -2837,7 +2837,7 @@ static struct audio_client * audio_test(void)
clk_enable(sdac_clk);

// 1. attach ADIE
adie = dal_attach_ex(ADIE_DAL_DEVICE, "NULL", ADIE_DAL_PORT , 0, 0);
adie = dal_attach_ex(ADIE_DAL_DEVICE, "NULL", ADIE_DAL_PORT, 0, 0, 0);
if (!adie)
{
pr_err("audio_init: cannot attach to adie\n");
Expand All @@ -2853,7 +2853,7 @@ static struct audio_client * audio_test(void)
dal_call_f9(adie, DAL_OP_INFO, &info, sizeof(info));


acdb = dal_attach(ACDB_DAL_DEVICE, ACDB_DAL_PORT, 0, 0);
acdb = dal_attach(ACDB_DAL_DEVICE, ACDB_DAL_PORT, 0, 0, 0);
if (!acdb)
{
pr_err("audio_init: cannot attach to acdb channel\n");
Expand Down

0 comments on commit 25ac01d

Please sign in to comment.