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

Commit 0764de64 authored by Bob Copeland's avatar Bob Copeland Committed by John W. Linville
Browse files

wl1251: separate bus i/o code into io.c



In order to eventually support wl1251 spi and sdio interfaces, move
the register and memory transfer functions to a common file.  Also
rename wl1251_spi_mem_{read,write} to indicate its common usage.
We still use spi_read internally until SDIO interface is introduced
so nothing functional should change here.

Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b8010790
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
wl1251-objs		= wl1251_main.o wl1251_spi.o wl1251_event.o \
			  wl1251_tx.o wl1251_rx.o wl1251_ps.o wl1251_cmd.o \
			  wl1251_acx.o wl1251_boot.o wl1251_init.o \
			  wl1251_ops.o wl1251_debugfs.o
			  wl1251_ops.o wl1251_debugfs.o wl1251_io.o
obj-$(CONFIG_WL1251)	+= wl1251.o

wl1271-objs		= wl1271_main.o  wl1271_spi.o wl1271_cmd.o  \
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@

#include "wl1251.h"
#include "reg.h"
#include "wl1251_spi.h"
#include "wl1251_cmd.h"
#include "wl1251_ps.h"

int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod,
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@

#include "reg.h"
#include "wl1251_boot.h"
#include "wl1251_spi.h"
#include "wl1251_io.h"
#include "wl1251_event.h"

static void wl1251_boot_enable_interrupts(struct wl1251 *wl)
+5 −5
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@

#include "wl1251.h"
#include "reg.h"
#include "wl1251_spi.h"
#include "wl1251_io.h"
#include "wl1251_ps.h"
#include "wl1251_acx.h"

@@ -31,7 +31,7 @@ int wl1251_cmd_send(struct wl1251 *wl, u16 id, void *buf, size_t len)

	WARN_ON(len % 4 != 0);

	wl1251_spi_mem_write(wl, wl->cmd_box_addr, buf, len);
	wl1251_mem_write(wl, wl->cmd_box_addr, buf, len);

	wl1251_reg_write32(wl, ACX_REG_INTERRUPT_TRIG, INTR_TRIG_CMD);

@@ -86,7 +86,7 @@ int wl1251_cmd_test(struct wl1251 *wl, void *buf, size_t buf_len, u8 answer)
		 * The answer would be a wl1251_command, where the
		 * parameter array contains the actual answer.
		 */
		wl1251_spi_mem_read(wl, wl->cmd_box_addr, buf, buf_len);
		wl1251_mem_read(wl, wl->cmd_box_addr, buf, buf_len);

		cmd_answer = buf;

@@ -125,7 +125,7 @@ int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len)
	}

	/* the interrogate command got in, we can read the answer */
	wl1251_spi_mem_read(wl, wl->cmd_box_addr, buf, len);
	wl1251_mem_read(wl, wl->cmd_box_addr, buf, len);

	acx = buf;
	if (acx->cmd.status != CMD_STATUS_SUCCESS)
@@ -379,7 +379,7 @@ int wl1251_cmd_read_memory(struct wl1251 *wl, u32 addr, void *answer,
	}

	/* the read command got in, we can now read the answer */
	wl1251_spi_mem_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd));
	wl1251_mem_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd));

	if (cmd->header.status != CMD_STATUS_SUCCESS)
		wl1251_error("error in read command result: %d",
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@

#include "wl1251.h"
#include "reg.h"
#include "wl1251_spi.h"
#include "wl1251_io.h"
#include "wl1251_event.h"
#include "wl1251_ps.h"

@@ -112,7 +112,7 @@ int wl1251_event_handle(struct wl1251 *wl, u8 mbox_num)
		return -EINVAL;

	/* first we read the mbox descriptor */
	wl1251_spi_mem_read(wl, wl->mbox_ptr[mbox_num], &mbox,
	wl1251_mem_read(wl, wl->mbox_ptr[mbox_num], &mbox,
			    sizeof(struct event_mailbox));

	/* process the descriptor */
Loading