|
20 | 20 | #include <sound/pcm.h>
|
21 | 21 | #include <sound/pcm_params.h>
|
22 | 22 | #include <linux/pm_runtime.h>
|
| 23 | +#include <linux/units.h> |
23 | 24 | #include <sound/soc.h>
|
24 | 25 | #include <sound/initval.h>
|
25 | 26 | #include <sound/tlv.h>
|
@@ -1559,7 +1560,7 @@ static int da7213_set_component_sysclk(struct snd_soc_component *component,
|
1559 | 1560 | if (freq == 0)
|
1560 | 1561 | return 0;
|
1561 | 1562 |
|
1562 |
| - if (((freq < 5000000) && (freq != 32768)) || (freq > 54000000)) { |
| 1563 | + if (((freq < da7213->fin_min_rate) && (freq != 32768)) || (freq > 54000000)) { |
1563 | 1564 | dev_err(component->dev, "Unsupported MCLK value %d\n",
|
1564 | 1565 | freq);
|
1565 | 1566 | return -EINVAL;
|
@@ -1858,20 +1859,23 @@ static int da7213_set_bias_level(struct snd_soc_component *component,
|
1858 | 1859 | return 0;
|
1859 | 1860 | }
|
1860 | 1861 |
|
| 1862 | +#define DA7213_FIN_MIN_RATE (5 * MEGA) |
| 1863 | +#define DA7212_FIN_MIN_RATE (2 * MEGA) |
| 1864 | + |
1861 | 1865 | #if defined(CONFIG_OF)
|
1862 | 1866 | /* DT */
|
1863 | 1867 | static const struct of_device_id da7213_of_match[] = {
|
1864 |
| - { .compatible = "dlg,da7212", }, |
1865 |
| - { .compatible = "dlg,da7213", }, |
| 1868 | + { .compatible = "dlg,da7212", .data = (void *)DA7212_FIN_MIN_RATE }, |
| 1869 | + { .compatible = "dlg,da7213", .data = (void *)DA7213_FIN_MIN_RATE }, |
1866 | 1870 | { }
|
1867 | 1871 | };
|
1868 | 1872 | MODULE_DEVICE_TABLE(of, da7213_of_match);
|
1869 | 1873 | #endif
|
1870 | 1874 |
|
1871 | 1875 | #ifdef CONFIG_ACPI
|
1872 | 1876 | static const struct acpi_device_id da7213_acpi_match[] = {
|
1873 |
| - { "DLGS7212", 0}, |
1874 |
| - { "DLGS7213", 0}, |
| 1877 | + { "DLGS7212", DA7212_FIN_MIN_RATE }, |
| 1878 | + { "DLGS7213", DA7213_FIN_MIN_RATE }, |
1875 | 1879 | { },
|
1876 | 1880 | };
|
1877 | 1881 | MODULE_DEVICE_TABLE(acpi, da7213_acpi_match);
|
@@ -2167,6 +2171,10 @@ static int da7213_i2c_probe(struct i2c_client *i2c)
|
2167 | 2171 | if (!da7213)
|
2168 | 2172 | return -ENOMEM;
|
2169 | 2173 |
|
| 2174 | + da7213->fin_min_rate = (uintptr_t)i2c_get_match_data(i2c); |
| 2175 | + if (!da7213->fin_min_rate) |
| 2176 | + return -EINVAL; |
| 2177 | + |
2170 | 2178 | i2c_set_clientdata(i2c, da7213);
|
2171 | 2179 |
|
2172 | 2180 | /* Get required supplies */
|
|
0 commit comments