Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83c3a7d4 authored by Eliad Peller's avatar Eliad Peller Committed by Tony Lindgren
Browse files

wlcore: remove wl12xx_platform_data



Now that we have wlcore device-tree bindings in place
(for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_data struct, and move its members
into the platform device data (that is passed to wlcore)

Davinci 850 is the only platform that still set
the platform data in the legacy way (and doesn't
have DT bindings), so remove the relevant
code/Kconfig option from the board file (as suggested
by Sekhar Nori)

Since no one currently uses wlcore_spi, simply remove its
platform data support (DT bindings will have to be added
if someone actually needs it)

Signed-off-by: default avatarLuciano Coelho <luca@coelho.fi>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Tested-by: default avatarNikita Kiryanov <nikita@compulab.co.il>
Acked-by: default avatarKalle Valo <kvalo@codeaurora.org>
Acked-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 99f84cae
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -200,17 +200,6 @@ config DA850_UI_SD_VIDEO_PORT

endchoice

config DA850_WL12XX
	bool "AM18x wl1271 daughter board"
	depends on MACH_DAVINCI_DA850_EVM
	help
	  The wl1271 daughter card for AM18x EVMs is a combo wireless
	  connectivity add-on card, based on the LS Research TiWi module with
	  Texas Instruments' wl1271 solution.
	  Say Y if you want to use a wl1271 expansion card connected to the
	  AM18x EVM.


config MACH_MITYOMAPL138
	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
	depends on ARCH_DAVINCI_DA850
+0 −113
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
#include <linux/regulator/fixed.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#include <linux/wl12xx.h>

#include <mach/common.h>
#include <mach/cp_intc.h>
@@ -60,9 +59,6 @@
#define DA850_MMCSD_CD_PIN		GPIO_TO_PIN(4, 0)
#define DA850_MMCSD_WP_PIN		GPIO_TO_PIN(4, 1)

#define DA850_WLAN_EN			GPIO_TO_PIN(6, 9)
#define DA850_WLAN_IRQ			GPIO_TO_PIN(6, 10)

#define DA850_MII_MDIO_CLKEN_PIN	GPIO_TO_PIN(2, 6)

static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
static __init void da850_vpif_init(void) {}
#endif

#ifdef CONFIG_DA850_WL12XX

static void wl12xx_set_power(int index, bool power_on)
{
	static bool power_state;

	pr_debug("Powering %s wl12xx", power_on ? "on" : "off");

	if (power_on == power_state)
		return;
	power_state = power_on;

	if (power_on) {
		/* Power up sequence required for wl127x devices */
		gpio_set_value(DA850_WLAN_EN, 1);
		usleep_range(15000, 15000);
		gpio_set_value(DA850_WLAN_EN, 0);
		usleep_range(1000, 1000);
		gpio_set_value(DA850_WLAN_EN, 1);
		msleep(70);
	} else {
		gpio_set_value(DA850_WLAN_EN, 0);
	}
}

static struct davinci_mmc_config da850_wl12xx_mmc_config = {
	.set_power	= wl12xx_set_power,
	.wires		= 4,
	.max_freq	= 25000000,
	.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
			  MMC_CAP_POWER_OFF_CARD,
};

static const short da850_wl12xx_pins[] __initconst = {
	DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
	DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
	DA850_GPIO6_9, DA850_GPIO6_10,
	-1
};

static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
	.irq			= -1,
	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
	.ref_clock_freq		= 38400000,
	.ref_clock_xtal		= false,
};

static __init int da850_wl12xx_init(void)
{
	int ret;

	ret = davinci_cfg_reg_list(da850_wl12xx_pins);
	if (ret) {
		pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
		goto exit;
	}

	ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
	if (ret) {
		pr_err("wl12xx/mmc registration failed: %d\n", ret);
		goto exit;
	}

	ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
	if (ret) {
		pr_err("Could not request wl12xx enable gpio: %d\n", ret);
		goto exit;
	}

	ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
	if (ret) {
		pr_err("Could not request wl12xx irq gpio: %d\n", ret);
		goto free_wlan_en;
	}

	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);

	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
	if (ret) {
		pr_err("Could not set wl12xx data: %d\n", ret);
		goto free_wlan_irq;
	}

	return 0;

free_wlan_irq:
	gpio_free(DA850_WLAN_IRQ);

free_wlan_en:
	gpio_free(DA850_WLAN_EN);

exit:
	return ret;
}

#else /* CONFIG_DA850_WL12XX */

static __init int da850_wl12xx_init(void)
{
	return 0;
}

#endif /* CONFIG_DA850_WL12XX */

#define DA850EVM_SATA_REFCLKPN_RATE	(100 * 1000 * 1000)

static __init void da850_evm_init(void)
@@ -1503,11 +1395,6 @@ static __init void da850_evm_init(void)
		if (ret)
			pr_warn("%s: MMCSD0 registration failed: %d\n",
				__func__, ret);

		ret = da850_wl12xx_init();
		if (ret)
			pr_warn("%s: WL12xx initialization failed: %d\n",
				__func__, ret);
	}

	davinci_serial_init(da8xx_serial_device);
+0 −25
Original line number Diff line number Diff line
@@ -23,31 +23,6 @@
#include <linux/err.h>
#include <linux/wl12xx.h>

static struct wl12xx_platform_data *wl12xx_platform_data;

int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
{
	if (wl12xx_platform_data)
		return -EBUSY;
	if (!data)
		return -EINVAL;

	wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
	if (!wl12xx_platform_data)
		return -ENOMEM;

	return 0;
}

struct wl12xx_platform_data *wl12xx_get_platform_data(void)
{
	if (!wl12xx_platform_data)
		return ERR_PTR(-ENODEV);

	return wl12xx_platform_data;
}
EXPORT_SYMBOL(wl12xx_get_platform_data);

static struct wl1251_platform_data *wl1251_platform_data;

int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
+8 −11
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@

#include <linux/err.h>

#include <linux/wl12xx.h>

#include "../wlcore/wlcore.h"
#include "../wlcore/debug.h"
#include "../wlcore/io.h"
@@ -1808,7 +1806,6 @@ static int wl12xx_setup(struct wl1271 *wl)
{
	struct wl12xx_priv *priv = wl->priv;
	struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
	struct wl12xx_platform_data *pdata = pdev_data->pdata;

	BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
	BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
@@ -1834,12 +1831,12 @@ static int wl12xx_setup(struct wl1271 *wl)

	if (!fref_param) {
		priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
						       pdata->ref_clock_freq,
						       pdata->ref_clock_xtal);
						pdev_data->ref_clock_freq,
						pdev_data->ref_clock_xtal);
		if (priv->ref_clock < 0) {
			wl1271_error("Invalid ref_clock frequency (%d Hz, %s)",
				     pdata->ref_clock_freq,
				     pdata->ref_clock_xtal ?
				     pdev_data->ref_clock_freq,
				     pdev_data->ref_clock_xtal ?
				     "XTAL" : "not XTAL");

			return priv->ref_clock;
@@ -1861,13 +1858,13 @@ static int wl12xx_setup(struct wl1271 *wl)
			wl1271_error("Invalid fref parameter %s", fref_param);
	}

	if (!tcxo_param && pdata->tcxo_clock_freq) {
	if (!tcxo_param && pdev_data->tcxo_clock_freq) {
		priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
							pdata->tcxo_clock_freq,
						pdev_data->tcxo_clock_freq,
						true);
		if (priv->tcxo_clock < 0) {
			wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
				     pdata->tcxo_clock_freq);
				     pdev_data->tcxo_clock_freq);

			return priv->tcxo_clock;
		}
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
 */

#include <linux/slab.h>
#include <linux/wl12xx.h>
#include <linux/export.h>

#include "debug.h"
Loading