lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150502235738.GB27804@kwestfie-linux.qualcomm.com>
Date:	Sat, 2 May 2015 16:57:39 -0700
From:	Kenneth Westfield <kwestfie@...eaurora.org>
To:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:	Patrick Lai <plai@...eaurora.org>, Mark Brown <broonie@...nel.org>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Banajit Goswami <bgoswami@...eaurora.org>,
	Kenneth Westfield <kwestfie@...eaurora.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	alsa-devel@...a-project.org, linux-arm-msm@...r.kernel.org
Subject: Re: [RFC PATCH 03/14] ASoC: qcom: move ipq806x specific bits out of
 lpass driver.

On Thu, Apr 30, 2015 at 06:16:53PM +0100, Srinivas Kandagatla wrote:
> This patch tries to make the lpass driver more generic by moving the
> ipq806x specific bits out of the cpu and platform driver, also allows the
> SOC specific drivers to add the correct register offsets.
> 
> This patch also renames the register definition header file into more
> generic header file.

> diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c
> new file mode 100644
> index 0000000..8e9a427
> --- /dev/null
> +++ b/sound/soc/qcom/lpass-ipq806x.c

> +static const struct of_device_id ipq806x_lpass_cpu_device_id[] = {
> +	{ .compatible = "qcom,lpass-cpu", .data = &ipq806x_data },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, ipq806x_lpass_cpu_device_id);

Surround with #ifdef CONFIG_OF?

> diff --git a/sound/soc/qcom/lpass-lpaif-reg.h b/sound/soc/qcom/lpass-lpaif-reg.h
> new file mode 100644
> index 0000000..5541b14
> --- /dev/null
> +++ b/sound/soc/qcom/lpass-lpaif-reg.h

> +#define LPAIF_I2SCTL_REG_ADDR(v, addr, port) \
> +	(v->i2sctrl_reg_base + (addr) + v->i2sctrl_reg_stride * (port))

Could all of these variant-related macros be eliminated by using the
regmap_fields_* accessor functions, instead of the regmap_* functions?

> +enum lpaif_i2s_ports {
> +	LPAIF_I2S_PORT_MIN		= 0,
> +
> +	LPAIF_I2S_PORT_CODEC_SPK	= 0,
> +	LPAIF_I2S_PORT_CODEC_MIC	= 1,
> +	LPAIF_I2S_PORT_SEC_SPK		= 2,
> +	LPAIF_I2S_PORT_SEC_MIC		= 3,
> +	LPAIF_I2S_PORT_MI2S		= 4,
> +
> +	LPAIF_I2S_PORT_MAX		= 4,
> +	LPAIF_I2S_PORT_NUM		= 5,
> +};

These port mappings here...

> +enum lpaif_irq_ports {
> +	LPAIF_IRQ_PORT_MIN		= 0,
> +
> +	LPAIF_IRQ_PORT_HOST		= 0,
> +	LPAIF_IRQ_PORT_ADSP		= 1,
> +
> +	LPAIF_IRQ_PORT_MAX		= 2,
> +	LPAIF_IRQ_PORT_NUM		= 3,
> +};

...here...

> +enum lpaif_dma_channels {
> +	LPAIF_RDMA_CHAN_MIN		= 0,
> +
> +	LPAIF_RDMA_CHAN_MI2S		= 0,
> +	LPAIF_RDMA_CHAN_PCM0		= 1,
> +	LPAIF_RDMA_CHAN_PCM1		= 2,
> +
> +	LPAIF_RDMA_CHAN_MAX		= 4,
> +	LPAIF_RDMA_CHAN_NUM		= 5,
> +};

...and here can be SOC-specific.  Should move them to the SOC-specific
files.

> diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
> index 5c99b3d..5bd2a90 100644
> --- a/sound/soc/qcom/lpass.h
> +++ b/sound/soc/qcom/lpass.h

>  /* register the platform driver from the CPU DAI driver */
>  int asoc_qcom_lpass_platform_register(struct platform_device *);
> +int lpass_cpu_platform_remove(struct platform_device *pdev);
> +int lpass_cpu_platform_probe(struct platform_device *pdev);
> +int lpass_cpu_dai_probe(struct snd_soc_dai *dai);
> +extern struct snd_soc_dai_ops lpass_cpu_dai_ops;

Prefix with asoc_qcom_ to reduce chance of collisions.

-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ