@@ -118,9 +118,7 @@ static struct davinci_i2c_platform_data i2c_pdata = {
.bus_delay = 0 /* usec */,
};
-static struct snd_platform_data dm355_evm_snd_data = {
- .clk_name = "asp1",
-};
+static struct snd_platform_data dm355_evm_snd_data;
static int dm355evm_mmc_gpios = -EINVAL;
@@ -286,7 +284,10 @@ static __init void dm355_evm_init(void)
ARRAY_SIZE(dm355_evm_spi_info));
/* DM335 EVM uses ASP1; line-out is a stereo mini-jack */
- dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN, &dm355_evm_snd_data);
+ dm355_evm_snd_data.clk = clk_get(NULL, "asp1");
+ if (!WARN_ON(!dm355_evm_snd_data.clk))
+ dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN,
+ &dm355_evm_snd_data);
}
static __init void dm355_evm_irq_init(void)
@@ -226,9 +226,7 @@ static struct platform_device ide_dev = {
},
};
-static struct snd_platform_data dm644x_evm_snd_data = {
- .clk_name = "asp0",
-};
+static struct snd_platform_data dm644x_evm_snd_data;
/*----------------------------------------------------------------------*/
@@ -671,7 +669,10 @@ static __init void davinci_evm_init(void)
davinci_setup_mmc(0, &dm6446evm_mmc_config);
davinci_serial_init(&uart_config);
- dm644x_init_asp(&dm644x_evm_snd_data);
+
+ dm644x_evm_snd_data.clk = clk_get(NULL, "asp0");
+ if (!WARN_ON(!dm644x_evm_snd_data.clk))
+ dm644x_init_asp(&dm644x_evm_snd_data);
soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK;
soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY;
@@ -33,6 +33,7 @@
#include <linux/i2c/at24.h>
#include <linux/i2c/pcf857x.h>
#include <linux/etherdevice.h>
+#include <linux/clk.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -217,7 +218,6 @@ static u8 dm646x_dit_serializer_direction[] = {
static struct snd_platform_data dm646x_evm_snd_data[] = {
{
- .clk_name = "mcasp0",
.tx_dma_offset = 0x400,
.rx_dma_offset = 0x400,
.op_mode = DAVINCI_MCASP_IIS_MODE,
@@ -227,7 +227,6 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {
.eventq_no = EVENTQ_0,
},
{
- .clk_name = "mcasp1",
.tx_dma_offset = 0x400,
.rx_dma_offset = 0,
.op_mode = DAVINCI_MCASP_DIT_MODE,
@@ -271,8 +270,13 @@ static __init void evm_init(void)
evm_init_i2c();
davinci_serial_init(&uart_config);
- dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
- dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
+
+ dm646x_evm_snd_data[0].clk = clk_get(NULL, "mcasp0");
+ if (!WARN_ON(!dm646x_evm_snd_data[0].clk))
+ dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
+ dm646x_evm_snd_data[1].clk = clk_get(NULL, "mcasp1");
+ if (!WARN_ON(!dm646x_evm_snd_data[1].clk))
+ dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
@@ -33,7 +33,7 @@
#define DAVINCI_ASP1_TX_INT IRQ_MBXINT
struct snd_platform_data {
- char *clk_name;
+ struct clk *clk;
u32 tx_dma_offset;
u32 rx_dma_offset;
enum dma_event_q eventq_no; /* event queue number */
Clock name strings should not be passed along to drivers. Rather, let platform code get the correct clock for the platform, and pass it along to ASoC via platform data. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> --- Applies to current DaVinci git. arch/arm/mach-davinci/board-dm355-evm.c | 9 +++++---- arch/arm/mach-davinci/board-dm644x-evm.c | 9 +++++---- arch/arm/mach-davinci/board-dm646x-evm.c | 12 ++++++++---- arch/arm/mach-davinci/include/mach/asp.h | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-)