Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 392b46f3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HSI changes from Sebastian Reichel:

 - nokia-modem: support speech data
 - misc fixes

* tag 'hsi-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: cmt_speech: fix error return code
  HSI: nokia-modem: Add cmt-speech support
  HSI: cmt_speech: Add cmt-speech driver
  HSI: nokia-modem: fix error return code
parents a21c1ea6 265ef3ee
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -6,13 +6,23 @@ comment "HSI clients"

config NOKIA_MODEM
	tristate "Nokia Modem"
	depends on HSI && SSI_PROTOCOL
	depends on HSI && SSI_PROTOCOL && CMT_SPEECH
	help
	Say Y here if you want to add support for the modem on Nokia
	N900 (Nokia RX-51) hardware.

	If unsure, say N.

config CMT_SPEECH
	tristate "CMT speech"
	depends on HSI && SSI_PROTOCOL
	help
	If you say Y here, you will enable the CMT speech protocol used
	by Nokia modems. If you say M the protocol will be available as
	module named cmt_speech.

	If unsure, say N.

config SSI_PROTOCOL
	tristate "SSI protocol"
	depends on HSI && PHONET && OMAP_SSI
+1 −0
Original line number Diff line number Diff line
@@ -4,4 +4,5 @@

obj-$(CONFIG_NOKIA_MODEM)	+= nokia-modem.o
obj-$(CONFIG_SSI_PROTOCOL)	+= ssi_protocol.o
obj-$(CONFIG_CMT_SPEECH)	+= cmt_speech.o
obj-$(CONFIG_HSI_CHAR)		+= hsi_char.o
+1457 −0

File added.

Preview size limit exceeded, changes collapsed.

+32 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ struct nokia_modem_device {
	struct nokia_modem_gpio	*gpios;
	int			gpio_amount;
	struct hsi_client	*ssi_protocol;
	struct hsi_client	*cmt_speech;
};

static void do_nokia_modem_rst_ind_tasklet(unsigned long data)
@@ -149,6 +150,7 @@ static int nokia_modem_probe(struct device *dev)
	struct hsi_port *port = hsi_get_port(cl);
	int irq, pflags, err;
	struct hsi_board_info ssip;
	struct hsi_board_info cmtspeech;

	np = dev->of_node;
	if (!np) {
@@ -200,6 +202,7 @@ static int nokia_modem_probe(struct device *dev)
	modem->ssi_protocol = hsi_new_client(port, &ssip);
	if (!modem->ssi_protocol) {
		dev_err(dev, "Could not register ssi-protocol device\n");
		err = -ENOMEM;
		goto error2;
	}

@@ -213,12 +216,35 @@ static int nokia_modem_probe(struct device *dev)
		goto error3;
	}

	/* TODO: register cmt-speech hsi client */
	cmtspeech.name = "cmt-speech";
	cmtspeech.tx_cfg = cl->tx_cfg;
	cmtspeech.rx_cfg = cl->rx_cfg;
	cmtspeech.platform_data = NULL;
	cmtspeech.archdata = NULL;

	modem->cmt_speech = hsi_new_client(port, &cmtspeech);
	if (!modem->cmt_speech) {
		dev_err(dev, "Could not register cmt-speech device\n");
		err = -ENOMEM;
		goto error3;
	}

	err = device_attach(&modem->cmt_speech->device);
	if (err == 0) {
		dev_err(dev, "Missing cmt-speech driver\n");
		err = -EPROBE_DEFER;
		goto error4;
	} else if (err < 0) {
		dev_err(dev, "Could not load cmt-speech driver (%d)\n", err);
		goto error4;
	}

	dev_info(dev, "Registered Nokia HSI modem\n");

	return 0;

error4:
	hsi_remove_client(&modem->cmt_speech->device, NULL);
error3:
	hsi_remove_client(&modem->ssi_protocol->device, NULL);
error2:
@@ -237,6 +263,11 @@ static int nokia_modem_remove(struct device *dev)
	if (!modem)
		return 0;

	if (modem->cmt_speech) {
		hsi_remove_client(&modem->cmt_speech->device, NULL);
		modem->cmt_speech = NULL;
	}

	if (modem->ssi_protocol) {
		hsi_remove_client(&modem->ssi_protocol->device, NULL);
		modem->ssi_protocol = NULL;
+1 −1
Original line number Diff line number Diff line
# UAPI Header export list
header-y += hsi_char.h
header-y += hsi_char.h cs-protocol.h
Loading