aiu = devm_kzalloc(dev, sizeof(*aiu), GFP_KERNEL);
if (!aiu)
return -ENOMEM;
+
+ aiu->platform = device_get_match_data(dev);
+ if (!aiu->platform)
+ return -ENODEV;
+
platform_set_drvdata(pdev, aiu);
ret = device_reset(dev);
}
/* Register the internal dac control component on gxl */
- if (of_device_is_compatible(dev->of_node, "amlogic,aiu-gxl")) {
+ if (aiu->platform->has_acodec) {
ret = aiu_acodec_ctrl_register_component(dev);
if (ret) {
dev_err(dev,
return 0;
}
+static const struct aiu_platform_data aiu_gxbb_pdata = {
+ .has_acodec = false,
+};
+
+static const struct aiu_platform_data aiu_gxl_pdata = {
+ .has_acodec = true,
+};
+
static const struct of_device_id aiu_of_match[] = {
- { .compatible = "amlogic,aiu-gxbb", },
- { .compatible = "amlogic,aiu-gxl", },
+ { .compatible = "amlogic,aiu-gxbb", .data = &aiu_gxbb_pdata },
+ { .compatible = "amlogic,aiu-gxl", .data = &aiu_gxl_pdata },
{}
};
MODULE_DEVICE_TABLE(of, aiu_of_match);
int irq;
};
+struct aiu_platform_data {
+ bool has_acodec;
+};
+
struct aiu {
struct clk *pclk;
struct clk *spdif_mclk;
struct aiu_interface i2s;
struct aiu_interface spdif;
+ const struct aiu_platform_data *platform;
};
#define AIU_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \