File: spi.h

package info (click to toggle)
u-boot 2025.01-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 330,740 kB
  • sloc: ansic: 2,627,855; python: 60,773; sh: 41,641; asm: 21,854; makefile: 15,048; perl: 12,447; cs: 6,763; cpp: 1,868; yacc: 1,100; lex: 747; awk: 57; tcl: 32; sed: 24
file content (35 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Simulate a SPI port and clients (see doc/arch/sandbox.rst for details)
 *
 * Copyright (c) 2011-2013 The Chromium OS Authors.
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * Licensed under the GPL-2 or later.
 */

#ifndef __ASM_SPI_H__
#define __ASM_SPI_H__

#include <linux/types.h>

/*
 * The interface between the SPI bus and the SPI client.  The bus will
 * instantiate a client, and that then call into it via these entry
 * points.  These should be enough for the client to emulate the SPI
 * device just like the real hardware.
 */
struct sandbox_spi_emu_ops {
	/* The bus wants to instantiate a new client, so setup everything */
	int (*setup)(void **priv, const char *spec);
	/* The bus is done with us, so break things down */
	void (*free)(void *priv);
	/* The CS has been "activated" -- we won't worry about low/high */
	void (*cs_activate)(void *priv);
	/* The CS has been "deactivated" -- we won't worry about low/high */
	void (*cs_deactivate)(void *priv);
	/* The client is rx-ing bytes from the bus, so it should tx some */
	int (*xfer)(void *priv, const u8 *rx, u8 *tx, uint bytes);
};

#endif