Merge "asoc: codecs: Update file names of bolero" into audio-drivers.lnx.3.0
This commit is contained in:
commit
efc78a4e1b
7 changed files with 17 additions and 40 deletions
|
@ -11,7 +11,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/regmap.h>
|
||||
#include "bolero_cdc.h"
|
||||
#include "bolero-cdc.h"
|
||||
#include "internal.h"
|
||||
|
||||
static const struct reg_default bolero_defaults[] = {
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include "bolero_cdc.h"
|
||||
#include "bolero-cdc.h"
|
||||
#include "internal.h"
|
||||
|
||||
u8 bolero_tx_reg_access[BOLERO_CDC_TX_MACRO_MAX] = {
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/regmap.h>
|
||||
#include "bolero_cdc.h"
|
||||
#include "bolero-cdc.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define REG_BYTES 2
|
|
@ -19,7 +19,7 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#include "bolero_cdc.h"
|
||||
#include "bolero-cdc.h"
|
||||
#include "internal.h"
|
||||
|
||||
static struct snd_soc_codec_driver bolero;
|
||||
|
@ -441,9 +441,7 @@ static struct snd_soc_codec_driver bolero = {
|
|||
static void bolero_add_child_devices(struct work_struct *work)
|
||||
{
|
||||
struct bolero_priv *priv;
|
||||
struct platform_device *pdev;
|
||||
struct device_node *node;
|
||||
int ret, i, cnt = 0;
|
||||
int rc;
|
||||
|
||||
priv = container_of(work, struct bolero_priv,
|
||||
bolero_add_child_devices_work);
|
||||
|
@ -452,37 +450,17 @@ static void bolero_add_child_devices(struct work_struct *work)
|
|||
__func__);
|
||||
return;
|
||||
}
|
||||
if (!priv->dev->of_node) {
|
||||
if (!priv->dev || !priv->dev->of_node) {
|
||||
dev_err(priv->dev, "%s: DT node for bolero does not exist\n",
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
|
||||
for_each_child_of_node(priv->dev->of_node, node) {
|
||||
pdev = platform_device_alloc(node->name, -1);
|
||||
if (!pdev) {
|
||||
dev_err(priv->dev, "%s: pdev memory alloc failed\n",
|
||||
__func__);
|
||||
ret = -ENOMEM;
|
||||
goto fail_pdev_add;
|
||||
}
|
||||
pdev->dev.parent = priv->dev;
|
||||
pdev->dev.of_node = node;
|
||||
|
||||
ret = platform_device_add(pdev);
|
||||
if (ret) {
|
||||
dev_err(priv->dev,
|
||||
"%s: Cannot add platform device\n",
|
||||
__func__);
|
||||
goto fail_pdev_add;
|
||||
}
|
||||
priv->pdev_child_devices[cnt] = pdev;
|
||||
cnt++;
|
||||
}
|
||||
return;
|
||||
fail_pdev_add:
|
||||
for (i = cnt; i > 0; i--)
|
||||
platform_device_put(priv->pdev_child_devices[i - 1]);
|
||||
rc = of_platform_populate(priv->dev->of_node, NULL, NULL, priv->dev);
|
||||
if (rc)
|
||||
dev_err(priv->dev, "%s: failed to add child nodes, rc=%d\n",
|
||||
__func__, rc);
|
||||
else
|
||||
dev_dbg(priv->dev, "%s: added child node\n", __func__);
|
||||
}
|
||||
|
||||
static int bolero_probe(struct platform_device *pdev)
|
||||
|
@ -538,10 +516,11 @@ static int bolero_probe(struct platform_device *pdev)
|
|||
static int bolero_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bolero_priv *priv = dev_get_drvdata(&pdev->dev);
|
||||
u16 i;
|
||||
|
||||
for (i = priv->child_num; i > 0; i--)
|
||||
platform_device_unregister(priv->pdev_child_devices[i - 1]);
|
||||
if (!priv)
|
||||
return -EINVAL;
|
||||
|
||||
of_platform_depopulate(&pdev->dev);
|
||||
mutex_destroy(&priv->io_lock);
|
||||
mutex_destroy(&priv->clk_lock);
|
||||
return 0;
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef _BOLERO_INTERNAL_H
|
||||
#define _BOLERO_INTERNAL_H
|
||||
|
||||
#include "bolero_cdc_registers.h"
|
||||
#include "bolero-cdc-registers.h"
|
||||
|
||||
enum {
|
||||
REG_NO_ACCESS,
|
||||
|
@ -36,8 +36,6 @@ struct bolero_priv {
|
|||
u16 num_macros_registered;
|
||||
u16 child_num;
|
||||
u16 current_mclk_mux_macro[MAX_MACRO];
|
||||
struct platform_device *pdev_child_devices[MAX_MACRO];
|
||||
|
||||
struct work_struct bolero_add_child_devices_work;
|
||||
|
||||
int (*read_dev)(struct bolero_priv *priv,
|
||||
|
|
Loading…
Reference in a new issue