+++ /dev/null
-/*
- * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __SOUND_SAIF_H__
-#define __SOUND_SAIF_H__
-
-struct mxs_saif_platform_data {
- bool master_mode; /* if true use master mode */
- int master_id; /* id of the master if in slave mode */
-};
-#endif
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
-#include <sound/saif.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <mach/mxs.h>
struct device_node *np = pdev->dev.of_node;
struct resource *iores, *dmares;
struct mxs_saif *saif;
- struct mxs_saif_platform_data *pdata;
struct pinctrl *pinctrl;
int ret = 0;
+ struct device_node *master;
-
- if (!np && pdev->id >= ARRAY_SIZE(mxs_saif))
+ if (!np)
return -EINVAL;
saif = devm_kzalloc(&pdev->dev, sizeof(*saif), GFP_KERNEL);
if (!saif)
return -ENOMEM;
- if (np) {
- struct device_node *master;
- saif->id = of_alias_get_id(np, "saif");
- if (saif->id < 0)
- return saif->id;
- /*
- * If there is no "fsl,saif-master" phandle, it's a saif
- * master. Otherwise, it's a slave and its phandle points
- * to the master.
- */
- master = of_parse_phandle(np, "fsl,saif-master", 0);
- if (!master) {
- saif->master_id = saif->id;
- } else {
- saif->master_id = of_alias_get_id(master, "saif");
- if (saif->master_id < 0)
- return saif->master_id;
- }
+ saif->id = of_alias_get_id(np, "saif");
+ if (saif->id < 0)
+ return saif->id;
+ /*
+ * If there is no "fsl,saif-master" phandle, it's a saif
+ * master. Otherwise, it's a slave and its phandle points
+ * to the master.
+ */
+ master = of_parse_phandle(np, "fsl,saif-master", 0);
+ if (!master) {
+ saif->master_id = saif->id;
} else {
- saif->id = pdev->id;
- pdata = pdev->dev.platform_data;
- if (pdata && !pdata->master_mode)
- saif->master_id = pdata->master_id;
- else
- saif->master_id = saif->id;
+ saif->master_id = of_alias_get_id(master, "saif");
+ if (saif->master_id < 0)
+ return saif->master_id;
}
if (saif->master_id < 0 || saif->master_id >= ARRAY_SIZE(mxs_saif)) {