23 #include <linux/device.h>
25 #include <linux/module.h>
28 #include <linux/slab.h>
32 #define DRV_NAME "tegra20-das"
41 static inline u32 tegra20_das_read(
u32 reg)
60 tegra20_das_write(addr, reg);
67 int sdata1rx,
int sdata2rx)
82 tegra20_das_write(addr, reg);
102 tegra20_das_write(addr, reg);
108 #define LAST_REG(name) \
109 (TEGRA20_DAS_##name + \
110 (TEGRA20_DAS_##name##_STRIDE * (TEGRA20_DAS_##name##_COUNT - 1)))
112 static bool tegra20_das_wr_rd_reg(
struct device *
dev,
unsigned int reg)
118 (reg <=
LAST_REG(DAC_INPUT_DATA_CLK_SEL)))
124 static const struct regmap_config tegra20_das_regmap_config = {
128 .max_register =
LAST_REG(DAC_INPUT_DATA_CLK_SEL),
129 .writeable_reg = tegra20_das_wr_rd_reg,
130 .readable_reg = tegra20_das_wr_rd_reg,
145 dev_err(&pdev->
dev,
"Can't allocate tegra20_das\n");
159 resource_size(res), pdev->
name);
161 dev_err(&pdev->
dev,
"Memory region already claimed\n");
174 &tegra20_das_regmap_config);
175 if (IS_ERR(das->
regmap)) {
177 ret = PTR_ERR(das->
regmap);
184 dev_err(&pdev->
dev,
"Can't set up DAS DAP connection\n");
190 dev_err(&pdev->
dev,
"Can't set up DAS DAC connection\n");
194 platform_set_drvdata(pdev, das);
214 { .compatible =
"nvidia,tegra20-das", },
219 .probe = tegra20_das_probe,
224 .of_match_table = tegra20_das_of_match,