mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
asoc: tegra-alt: add prod support
This change is for adding prod settings for i2s dmic devices through device tree. bug 200059617 bug 200062746 Change-Id: I905743de44f556d7b5f02289545f0c472e540eb1 Signed-off-by: Dara Ramesh <dramesh@nvidia.com> Reviewed-on: http://git-master/r/682790 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
5923b73016
commit
9fb4155740
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* tegra210_dmic_alt.c - Tegra210 DMIC driver
|
* tegra210_dmic_alt.c - Tegra210 DMIC driver
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
#include <linux/pinctrl/pinconf-tegra.h>
|
||||||
|
|
||||||
#include "tegra210_xbar_alt.h"
|
#include "tegra210_xbar_alt.h"
|
||||||
#include "tegra210_dmic_alt.h"
|
#include "tegra210_dmic_alt.h"
|
||||||
@@ -337,11 +338,13 @@ static const struct of_device_id tegra210_dmic_of_match[] = {
|
|||||||
static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct tegra210_dmic *dmic;
|
struct tegra210_dmic *dmic;
|
||||||
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct resource *mem, *memregion;
|
struct resource *mem, *memregion;
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
struct tegra210_dmic_soc_data *soc_data;
|
struct tegra210_dmic_soc_data *soc_data;
|
||||||
|
const char *prod_name;
|
||||||
|
|
||||||
match = of_match_device(tegra210_dmic_of_match, &pdev->dev);
|
match = of_match_device(tegra210_dmic_of_match, &pdev->dev);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -399,8 +402,7 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
regcache_cache_only(dmic->regmap, true);
|
regcache_cache_only(dmic->regmap, true);
|
||||||
|
|
||||||
if (of_property_read_u32(pdev->dev.of_node,
|
if (of_property_read_u32(np, "nvidia,ahub-dmic-id",
|
||||||
"nvidia,ahub-dmic-id",
|
|
||||||
&pdev->dev.id) < 0) {
|
&pdev->dev.id) < 0) {
|
||||||
dev_err(&pdev->dev,
|
dev_err(&pdev->dev,
|
||||||
"Missing property nvidia,ahub-dmic-id\n");
|
"Missing property nvidia,ahub-dmic-id\n");
|
||||||
@@ -423,6 +425,9 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
|||||||
goto err_suspend;
|
goto err_suspend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (of_property_read_string(np, "prod-name", &prod_name) == 0)
|
||||||
|
tegra_pinctrl_config_prod(&pdev->dev, prod_name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_suspend:
|
err_suspend:
|
||||||
|
|||||||
@@ -31,12 +31,14 @@
|
|||||||
#include <sound/pcm_params.h>
|
#include <sound/pcm_params.h>
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <linux/pinctrl/consumer.h>
|
#include <linux/pinctrl/consumer.h>
|
||||||
|
#include <linux/pinctrl/pinconf-tegra.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/tegra-powergate.h>
|
#include <linux/tegra-powergate.h>
|
||||||
|
|
||||||
|
|
||||||
#include "tegra210_xbar_alt.h"
|
#include "tegra210_xbar_alt.h"
|
||||||
#include "tegra210_i2s_alt.h"
|
#include "tegra210_i2s_alt.h"
|
||||||
|
|
||||||
@@ -780,7 +782,7 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev)
|
|||||||
struct property *prop;
|
struct property *prop;
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
int ret = 0, count = 0, num_supplies;
|
int ret = 0, count = 0, num_supplies;
|
||||||
const char *supply;
|
const char *supply, *prod_name;
|
||||||
|
|
||||||
match = of_match_device(tegra210_i2s_of_match, &pdev->dev);
|
match = of_match_device(tegra210_i2s_of_match, &pdev->dev);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -892,6 +894,9 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev)
|
|||||||
of_property_read_bool(pdev->dev.of_node,
|
of_property_read_bool(pdev->dev.of_node,
|
||||||
"enable-cya");
|
"enable-cya");
|
||||||
|
|
||||||
|
if (of_property_read_string(np, "prod-name", &prod_name) == 0)
|
||||||
|
tegra_pinctrl_config_prod(&pdev->dev, prod_name);
|
||||||
|
|
||||||
num_supplies = of_property_count_strings(np, "regulator-supplies");
|
num_supplies = of_property_count_strings(np, "regulator-supplies");
|
||||||
if (num_supplies > 0) {
|
if (num_supplies > 0) {
|
||||||
i2s->num_supplies = num_supplies;
|
i2s->num_supplies = num_supplies;
|
||||||
|
|||||||
Reference in New Issue
Block a user