From: Sebastian Reichel <sre@kernel.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
Kai Vehmanen <kvcontact@nosignal.fi>, Pavel Machek <pavel@ucw.cz>,
Pali Rohar <pali.rohar@gmail.com>,
Aaro Koskinen <aaro.koskinen@iki.fi>,
Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-api@vger.kernel.org
Subject: [PATCH 8/9] HSI: cmt_speech: Remove hardcoded channel numbers
Date: Mon, 2 Mar 2015 05:38:58 +0100 [thread overview]
Message-ID: <1425271139-24715-9-git-send-email-sre@kernel.org> (raw)
In-Reply-To: <1425271139-24715-1-git-send-email-sre@kernel.org>
cmt-speech channel numbers should be coming from Device Tree
instead of being hardcoded.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
drivers/hsi/clients/cmt_speech.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 69dc37f..a017292 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -59,6 +59,9 @@ struct cs_char {
spinlock_t lock;
struct fasync_struct *async_queue;
wait_queue_head_t wait;
+ /* hsi channel ids */
+ int channel_id_cmd;
+ int channel_id_data;
};
#define SSI_CHANNEL_STATE_READING 1
@@ -66,9 +69,6 @@ struct cs_char {
#define SSI_CHANNEL_STATE_POLL (1 << 2)
#define SSI_CHANNEL_STATE_ERROR (1 << 3)
-#define CONTROL_HSI_CH 1
-#define DATA_HSI_CH 2
-
#define TARGET_MASK 0xf000000
#define TARGET_REMOTE (1 << CS_DOMAIN_SHIFT)
#define TARGET_LOCAL 0
@@ -296,7 +296,7 @@ static int cs_alloc_cmds(struct cs_hsi_iface *hi)
goto out;
}
sg_init_one(msg->sgt.sgl, buf, sizeof(*buf));
- msg->channel = CONTROL_HSI_CH;
+ msg->channel = cs_char_data.channel_id_cmd;
msg->context = hi;
list_add_tail(&msg->link, &hi->cmdqueue);
}
@@ -342,7 +342,7 @@ static int cs_hsi_alloc_data(struct cs_hsi_iface *hi)
res = -ENOMEM;
goto out1;
}
- rxmsg->channel = DATA_HSI_CH;
+ rxmsg->channel = cs_char_data.channel_id_data;
rxmsg->destructor = cs_hsi_data_destructor;
rxmsg->context = hi;
@@ -351,7 +351,7 @@ static int cs_hsi_alloc_data(struct cs_hsi_iface *hi)
res = -ENOMEM;
goto out2;
}
- txmsg->channel = DATA_HSI_CH;
+ txmsg->channel = cs_char_data.channel_id_data;
txmsg->destructor = cs_hsi_data_destructor;
txmsg->context = hi;
@@ -1382,6 +1382,22 @@ static int cs_hsi_client_probe(struct device *dev)
INIT_LIST_HEAD(&cs_char_data.chardev_queue);
INIT_LIST_HEAD(&cs_char_data.dataind_queue);
+ cs_char_data.channel_id_cmd = hsi_get_channel_id_by_name(cl,
+ "speech-control");
+ if (cs_char_data.channel_id_cmd < 0) {
+ err = cs_char_data.channel_id_cmd;
+ dev_err(dev, "Could not get cmd channel (%d)\n", err);
+ return err;
+ }
+
+ cs_char_data.channel_id_data = hsi_get_channel_id_by_name(cl,
+ "speech-data");
+ if (cs_char_data.channel_id_data < 0) {
+ err = cs_char_data.channel_id_data;
+ dev_err(dev, "Could not get data channel (%d)\n", err);
+ return err;
+ }
+
err = misc_register(&cs_char_miscdev);
if (err)
dev_err(dev, "Failed to register: %d\n", err);
--
2.1.4
next prev parent reply other threads:[~2015-03-02 4:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 4:38 [PATCH 0/9] N900 Modem Speech Support Sebastian Reichel
2015-03-02 4:38 ` [PATCH 1/9] HSI: cmt_speech: Add cmt-speech driver Sebastian Reichel
[not found] ` <1425271139-24715-2-git-send-email-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-03-02 10:22 ` Oliver Neukum
2015-03-02 10:22 ` Oliver Neukum
2015-03-02 15:26 ` Sebastian Reichel
2015-03-02 10:29 ` Oliver Neukum
2015-03-02 20:56 ` Aaro Koskinen
2015-03-02 4:38 ` [PATCH 2/9] HSI: cmt_speech: Avoid GFP_ATOMIC in cs_char_open Sebastian Reichel
2015-03-02 4:38 ` [PATCH 3/9] HSI: cmt_speech: Return error if HSI port not configured Sebastian Reichel
2015-03-02 4:38 ` [PATCH 4/9] HSI: cmt_speech: Fix build for 4.0 kernel Sebastian Reichel
2015-03-02 4:38 ` [PATCH 5/9] HSI: cmt_speech: Cleanup initialisation Sebastian Reichel
2015-03-02 4:38 ` [PATCH 6/9] HSI: cmt_speech: Rename driver to cmt-speech Sebastian Reichel
2015-03-02 4:38 ` [PATCH 7/9] HSI: cmt_speech: Move cs-protocol.h to include/uapi/linux/hsi Sebastian Reichel
2015-03-02 4:38 ` Sebastian Reichel [this message]
2015-03-02 4:38 ` [PATCH 9/9] HSI: nokia-modem: Add cmt_speech support Sebastian Reichel
2015-03-02 19:05 ` [PATCH 0/9] N900 Modem Speech Support Pali Rohár
2015-03-02 20:51 ` Sebastian Reichel
2015-03-03 17:46 ` Pali Rohár
2015-03-03 13:33 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425271139-24715-9-git-send-email-sre@kernel.org \
--to=sre@kernel.org \
--cc=aaro.koskinen@iki.fi \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=kvcontact@nosignal.fi \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=pali.rohar@gmail.com \
--cc=pavel@ucw.cz \
--cc=peter.ujfalusi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.