ASoC: ux500: Move DMA parameters into ux500_msp
Move struct ux500_msp_dma_params declaration from ux500_msp_i2s_drvdata to ux500_msp, this saves some confusing pointer passing and allows to access all DMA configuration fields from ux500_msp_i2s. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
a130243b96
commit
f3fe53dd97
|
@ -658,14 +658,11 @@ static int ux500_msp_dai_probe(struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev);
|
struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev);
|
||||||
|
|
||||||
drvdata->playback_dma_data.dma_cfg = drvdata->msp->dma_cfg_tx;
|
dai->playback_dma_data = &drvdata->msp->playback_dma_data;
|
||||||
drvdata->capture_dma_data.dma_cfg = drvdata->msp->dma_cfg_rx;
|
dai->capture_dma_data = &drvdata->msp->capture_dma_data;
|
||||||
|
|
||||||
dai->playback_dma_data = &drvdata->playback_dma_data;
|
drvdata->msp->playback_dma_data.data_size = drvdata->slot_width;
|
||||||
dai->capture_dma_data = &drvdata->capture_dma_data;
|
drvdata->msp->capture_dma_data.data_size = drvdata->slot_width;
|
||||||
|
|
||||||
drvdata->playback_dma_data.data_size = drvdata->slot_width;
|
|
||||||
drvdata->capture_dma_data.data_size = drvdata->slot_width;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,6 @@ enum ux500_msp_clock_id {
|
||||||
struct ux500_msp_i2s_drvdata {
|
struct ux500_msp_i2s_drvdata {
|
||||||
struct ux500_msp *msp;
|
struct ux500_msp *msp;
|
||||||
struct regulator *reg_vape;
|
struct regulator *reg_vape;
|
||||||
struct ux500_msp_dma_params playback_dma_data;
|
|
||||||
struct ux500_msp_dma_params capture_dma_data;
|
|
||||||
unsigned int fmt;
|
unsigned int fmt;
|
||||||
unsigned int tx_mask;
|
unsigned int tx_mask;
|
||||||
unsigned int rx_mask;
|
unsigned int rx_mask;
|
||||||
|
|
|
@ -367,12 +367,14 @@ static int enable_msp(struct ux500_msp *msp, struct ux500_msp_config *config)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the correct DMA-directions are configured */
|
/* Make sure the correct DMA-directions are configured */
|
||||||
if ((config->direction & MSP_DIR_RX) && (!msp->dma_cfg_rx)) {
|
if ((config->direction & MSP_DIR_RX) &&
|
||||||
|
!msp->capture_dma_data.dma_cfg) {
|
||||||
dev_err(msp->dev, "%s: ERROR: MSP RX-mode is not configured!",
|
dev_err(msp->dev, "%s: ERROR: MSP RX-mode is not configured!",
|
||||||
__func__);
|
__func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if ((config->direction == MSP_DIR_TX) && (!msp->dma_cfg_tx)) {
|
if ((config->direction == MSP_DIR_TX) &&
|
||||||
|
!msp->playback_dma_data.dma_cfg) {
|
||||||
dev_err(msp->dev, "%s: ERROR: MSP TX-mode is not configured!",
|
dev_err(msp->dev, "%s: ERROR: MSP TX-mode is not configured!",
|
||||||
__func__);
|
__func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -673,8 +675,8 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
|
||||||
|
|
||||||
msp->id = platform_data->id;
|
msp->id = platform_data->id;
|
||||||
msp->dev = &pdev->dev;
|
msp->dev = &pdev->dev;
|
||||||
msp->dma_cfg_rx = platform_data->msp_i2s_dma_rx;
|
msp->playback_dma_data.dma_cfg = platform_data->msp_i2s_dma_tx;
|
||||||
msp->dma_cfg_tx = platform_data->msp_i2s_dma_tx;
|
msp->capture_dma_data.dma_cfg = platform_data->msp_i2s_dma_rx;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
|
|
|
@ -468,12 +468,17 @@ struct ux500_msp_config {
|
||||||
unsigned int iodelay;
|
unsigned int iodelay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ux500_msp_dma_params {
|
||||||
|
unsigned int data_size;
|
||||||
|
struct stedma40_chan_cfg *dma_cfg;
|
||||||
|
};
|
||||||
|
|
||||||
struct ux500_msp {
|
struct ux500_msp {
|
||||||
enum msp_i2s_id id;
|
enum msp_i2s_id id;
|
||||||
void __iomem *registers;
|
void __iomem *registers;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct stedma40_chan_cfg *dma_cfg_rx;
|
struct ux500_msp_dma_params playback_dma_data;
|
||||||
struct stedma40_chan_cfg *dma_cfg_tx;
|
struct ux500_msp_dma_params capture_dma_data;
|
||||||
enum msp_state msp_state;
|
enum msp_state msp_state;
|
||||||
int def_elem_len;
|
int def_elem_len;
|
||||||
unsigned int dir_busy;
|
unsigned int dir_busy;
|
||||||
|
@ -481,11 +486,6 @@ struct ux500_msp {
|
||||||
unsigned int f_bitclk;
|
unsigned int f_bitclk;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ux500_msp_dma_params {
|
|
||||||
unsigned int data_size;
|
|
||||||
struct stedma40_chan_cfg *dma_cfg;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct msp_i2s_platform_data;
|
struct msp_i2s_platform_data;
|
||||||
int ux500_msp_i2s_init_msp(struct platform_device *pdev,
|
int ux500_msp_i2s_init_msp(struct platform_device *pdev,
|
||||||
struct ux500_msp **msp_p,
|
struct ux500_msp **msp_p,
|
||||||
|
|
Loading…
Reference in a new issue