Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * drivers/nfc/st95hf/spi.h functions declarations for SPI communication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * Copyright (C) 2015 STMicroelectronics – All Rights Reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #ifndef __LINUX_ST95HF_SPI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __LINUX_ST95HF_SPI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/spi/spi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* Basic ST95HF SPI CMDs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define ST95HF_COMMAND_SEND	0x0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define ST95HF_COMMAND_RESET	0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define ST95HF_COMMAND_RECEIVE	0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define ST95HF_RESET_CMD_LEN	0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  * structure to contain st95hf spi communication specific information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)  * @req_issync: true for synchronous calls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)  * @spidev: st95hf spi device object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)  * @done: completion structure to wait for st95hf response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)  *	for synchronous calls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)  * @spi_lock: mutex to allow only one spi transfer at a time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct st95hf_spi_context {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	bool req_issync;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	struct spi_device *spidev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	struct completion done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	struct mutex spi_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /* flag to differentiate synchronous & asynchronous spi request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) enum req_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	ASYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) int st95hf_spi_send(struct st95hf_spi_context *spicontext,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 		    unsigned char *buffertx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 		    int datalen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 		    enum req_type reqtype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) int st95hf_spi_recv_response(struct st95hf_spi_context *spicontext,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 			     unsigned char *receivebuff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) int st95hf_spi_recv_echo_res(struct st95hf_spi_context *spicontext,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 			     unsigned char *receivebuff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif