diff options
| -rw-r--r-- | drivers/hsi/clients/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/hsi/clients/nokia-modem.c | 32 |
2 files changed, 32 insertions, 2 deletions
diff --git a/drivers/hsi/clients/Kconfig b/drivers/hsi/clients/Kconfig index 86c849506f34..d6126200361f 100644 --- a/drivers/hsi/clients/Kconfig +++ b/drivers/hsi/clients/Kconfig | |||
| @@ -6,7 +6,7 @@ comment "HSI clients" | |||
| 6 | 6 | ||
| 7 | config NOKIA_MODEM | 7 | config NOKIA_MODEM |
| 8 | tristate "Nokia Modem" | 8 | tristate "Nokia Modem" |
| 9 | depends on HSI && SSI_PROTOCOL | 9 | depends on HSI && SSI_PROTOCOL && CMT_SPEECH |
| 10 | help | 10 | help |
| 11 | Say Y here if you want to add support for the modem on Nokia | 11 | Say Y here if you want to add support for the modem on Nokia |
| 12 | N900 (Nokia RX-51) hardware. | 12 | N900 (Nokia RX-51) hardware. |
diff --git a/drivers/hsi/clients/nokia-modem.c b/drivers/hsi/clients/nokia-modem.c index 9be4867fa224..bbb19231fa82 100644 --- a/drivers/hsi/clients/nokia-modem.c +++ b/drivers/hsi/clients/nokia-modem.c | |||
| @@ -46,6 +46,7 @@ struct nokia_modem_device { | |||
| 46 | struct nokia_modem_gpio *gpios; | 46 | struct nokia_modem_gpio *gpios; |
| 47 | int gpio_amount; | 47 | int gpio_amount; |
| 48 | struct hsi_client *ssi_protocol; | 48 | struct hsi_client *ssi_protocol; |
| 49 | struct hsi_client *cmt_speech; | ||
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 51 | static void do_nokia_modem_rst_ind_tasklet(unsigned long data) | 52 | static void do_nokia_modem_rst_ind_tasklet(unsigned long data) |
| @@ -149,6 +150,7 @@ static int nokia_modem_probe(struct device *dev) | |||
| 149 | struct hsi_port *port = hsi_get_port(cl); | 150 | struct hsi_port *port = hsi_get_port(cl); |
| 150 | int irq, pflags, err; | 151 | int irq, pflags, err; |
| 151 | struct hsi_board_info ssip; | 152 | struct hsi_board_info ssip; |
| 153 | struct hsi_board_info cmtspeech; | ||
| 152 | 154 | ||
| 153 | np = dev->of_node; | 155 | np = dev->of_node; |
| 154 | if (!np) { | 156 | if (!np) { |
| @@ -214,12 +216,35 @@ static int nokia_modem_probe(struct device *dev) | |||
| 214 | goto error3; | 216 | goto error3; |
| 215 | } | 217 | } |
| 216 | 218 | ||
| 217 | /* TODO: register cmt-speech hsi client */ | 219 | cmtspeech.name = "cmt-speech"; |
| 220 | cmtspeech.tx_cfg = cl->tx_cfg; | ||
| 221 | cmtspeech.rx_cfg = cl->rx_cfg; | ||
| 222 | cmtspeech.platform_data = NULL; | ||
| 223 | cmtspeech.archdata = NULL; | ||
| 224 | |||
| 225 | modem->cmt_speech = hsi_new_client(port, &cmtspeech); | ||
| 226 | if (!modem->cmt_speech) { | ||
| 227 | dev_err(dev, "Could not register cmt-speech device\n"); | ||
| 228 | err = -ENOMEM; | ||
| 229 | goto error3; | ||
| 230 | } | ||
| 231 | |||
| 232 | err = device_attach(&modem->cmt_speech->device); | ||
| 233 | if (err == 0) { | ||
| 234 | dev_err(dev, "Missing cmt-speech driver\n"); | ||
| 235 | err = -EPROBE_DEFER; | ||
| 236 | goto error4; | ||
| 237 | } else if (err < 0) { | ||
| 238 | dev_err(dev, "Could not load cmt-speech driver (%d)\n", err); | ||
| 239 | goto error4; | ||
| 240 | } | ||
| 218 | 241 | ||
| 219 | dev_info(dev, "Registered Nokia HSI modem\n"); | 242 | dev_info(dev, "Registered Nokia HSI modem\n"); |
| 220 | 243 | ||
| 221 | return 0; | 244 | return 0; |
| 222 | 245 | ||
| 246 | error4: | ||
| 247 | hsi_remove_client(&modem->cmt_speech->device, NULL); | ||
| 223 | error3: | 248 | error3: |
| 224 | hsi_remove_client(&modem->ssi_protocol->device, NULL); | 249 | hsi_remove_client(&modem->ssi_protocol->device, NULL); |
| 225 | error2: | 250 | error2: |
| @@ -238,6 +263,11 @@ static int nokia_modem_remove(struct device *dev) | |||
| 238 | if (!modem) | 263 | if (!modem) |
| 239 | return 0; | 264 | return 0; |
| 240 | 265 | ||
| 266 | if (modem->cmt_speech) { | ||
| 267 | hsi_remove_client(&modem->cmt_speech->device, NULL); | ||
| 268 | modem->cmt_speech = NULL; | ||
| 269 | } | ||
| 270 | |||
| 241 | if (modem->ssi_protocol) { | 271 | if (modem->ssi_protocol) { |
| 242 | hsi_remove_client(&modem->ssi_protocol->device, NULL); | 272 | hsi_remove_client(&modem->ssi_protocol->device, NULL); |
| 243 | modem->ssi_protocol = NULL; | 273 | modem->ssi_protocol = NULL; |
