Files
kernel_common_drivers/include/linux/amlogic/aml_spi.h
T
Sunny Luo 0f3f980eaf spicc: add dma transfer by vsync/line-n triggering support [1/1]
PD#SWPL-147512

Problem:
LDIM requires a strict timing sequence to match with the vsync signal

Solution:
SPICC supports vsync/line-n triggering control, Add a interface to
start/stop the vsync triggering transfer for LDIM
Porting from 5.4 1f62b7d1

Verify:
t3 t982

Change-Id: Ida2f63cbe318dceebbe97514e41a588e4ea143d4
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
2023-12-07 04:41:17 -07:00

61 lines
1.3 KiB
C

/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef __AML_SPI_H_
#define __AML_SPI_H_
enum {
DMA_TRIG_NORMAL = 0,
DMA_TRIG_VSYNC,
DMA_TRIG_LINE_N,
};
struct spicc_controller_data {
unsigned ccxfer_en:1;
unsigned timing_en:1;
unsigned ss_leading_gap:4;
unsigned ss_trailing_gap:4;
unsigned tx_tuning:4;
unsigned rx_tuning:4;
unsigned dummy_ctl:1;
void (*dirspi_start)(struct spi_device *spi);
void (*dirspi_stop)(struct spi_device *spi);
int (*dirspi_async)(struct spi_device *spi,
u8 *tx_buf,
u8 *rx_buf,
int len,
void (*complete)(void *context),
void *context);
int (*dirspi_sync)(struct spi_device *spi,
u8 *tx_buf,
u8 *rx_buf,
int len);
int (*dirspi_dma_trig)(struct spi_device *spi,
dma_addr_t tx_dma,
dma_addr_t rx_dma,
int len,
u8 src);
int (*dirspi_dma_trig_start)(struct spi_device *spi);
int (*dirspi_dma_trig_stop)(struct spi_device *spi);
};
struct spicc_transfer {
struct spi_transfer xfer;
unsigned dc_level:1;
#define DC_LEVEL_LOW 0
#define DC_LEVEL_HIGH 1
unsigned read_turn_around:2;
unsigned dc_mode:2;
#define DC_MODE_NONE 0
#define DC_MODE_PIN 1
#define DC_MODE_9BIT 2
void *tx_ccsg;
void *rx_ccsg;
int tx_ccsg_len;
int rx_ccsg_len;
};
#endif