Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (c) 2020, Linaro Limited
0004  */
0005 
0006 #ifndef QCOM_GPI_DMA_H
0007 #define QCOM_GPI_DMA_H
0008 
0009 /**
0010  * enum spi_transfer_cmd - spi transfer commands
0011  */
0012 enum spi_transfer_cmd {
0013     SPI_TX = 1,
0014     SPI_RX,
0015     SPI_DUPLEX,
0016 };
0017 
0018 /**
0019  * struct gpi_spi_config - spi config for peripheral
0020  *
0021  * @loopback_en: spi loopback enable when set
0022  * @clock_pol_high: clock polarity
0023  * @data_pol_high: data polarity
0024  * @pack_en: process tx/rx buffers as packed
0025  * @word_len: spi word length
0026  * @clk_div: source clock divider
0027  * @clk_src: serial clock
0028  * @cmd: spi cmd
0029  * @fragmentation: keep CS asserted at end of sequence
0030  * @cs: chip select toggle
0031  * @set_config: set peripheral config
0032  * @rx_len: receive length for buffer
0033  */
0034 struct gpi_spi_config {
0035     u8 set_config;
0036     u8 loopback_en;
0037     u8 clock_pol_high;
0038     u8 data_pol_high;
0039     u8 pack_en;
0040     u8 word_len;
0041     u8 fragmentation;
0042     u8 cs;
0043     u32 clk_div;
0044     u32 clk_src;
0045     enum spi_transfer_cmd cmd;
0046     u32 rx_len;
0047 };
0048 
0049 enum i2c_op {
0050     I2C_WRITE = 1,
0051     I2C_READ,
0052 };
0053 
0054 /**
0055  * struct gpi_i2c_config - i2c config for peripheral
0056  *
0057  * @pack_enable: process tx/rx buffers as packed
0058  * @cycle_count: clock cycles to be sent
0059  * @high_count: high period of clock
0060  * @low_count: low period of clock
0061  * @clk_div: source clock divider
0062  * @addr: i2c bus address
0063  * @stretch: stretch the clock at eot
0064  * @set_config: set peripheral config
0065  * @rx_len: receive length for buffer
0066  * @op: i2c cmd
0067  * @muli-msg: is part of multi i2c r-w msgs
0068  */
0069 struct gpi_i2c_config {
0070     u8 set_config;
0071     u8 pack_enable;
0072     u8 cycle_count;
0073     u8 high_count;
0074     u8 low_count;
0075     u8 addr;
0076     u8 stretch;
0077     u16 clk_div;
0078     u32 rx_len;
0079     enum i2c_op op;
0080     bool multi_msg;
0081 };
0082 
0083 #endif /* QCOM_GPI_DMA_H */