diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/mtd/spinand.h | 4 | ||||
| -rw-r--r-- | include/linux/platform_data/spi-s3c64xx.h | 3 | ||||
| -rw-r--r-- | include/linux/spi/spi-mem.h | 13 | ||||
| -rw-r--r-- | include/linux/spi/spi.h | 4 | ||||
| -rw-r--r-- | include/trace/events/qcom_geni_spi.h | 103 |
5 files changed, 119 insertions, 8 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 782984ba3a20..f53f5f0499b4 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -691,8 +691,6 @@ struct spinand_info { struct spinand_dirmap { struct spi_mem_dirmap_desc *wdesc; struct spi_mem_dirmap_desc *rdesc; - struct spi_mem_dirmap_desc *wdesc_ecc; - struct spi_mem_dirmap_desc *rdesc_ecc; }; /** @@ -869,6 +867,8 @@ static inline void spinand_set_of_node(struct spinand_device *spinand, nanddev_set_of_node(&spinand->base, np); } +bool spinand_op_is_odtr(const struct spi_mem_op *op); + int spinand_match_and_init(struct spinand_device *spinand, const struct spinand_info *table, unsigned int table_size, diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index 1d6e6c424fc6..f92bb4a1213b 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h @@ -30,6 +30,7 @@ struct s3c64xx_spi_csinfo { * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field. * @num_cs: Number of CS this controller emulates. * @no_cs: Used when CS line is not connected. + * @polling: Using polling mode when %true (no 'dmas' property in devicetree) * @cfg_gpio: Configure pins for this SPI controller. */ struct s3c64xx_spi_info { @@ -41,7 +42,7 @@ struct s3c64xx_spi_info { }; /** - * s3c64xx_spi_set_platdata - SPI Controller configure callback by the board + * s3c64xx_spi0_set_platdata - SPI Controller configure callback by the board * initialization code. * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks. * @num_cs: Number of elements in the 'cs' array. diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index c8e207522223..f660bb2e9f85 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -227,6 +227,8 @@ struct spi_mem_op { * struct spi_mem_dirmap_info - Direct mapping information * @op_tmpl: operation template that should be used by the direct mapping when * the memory device is accessed + * @secondary_op_tmpl: secondary template, may be used as an alternative to the + * primary template (decided by the upper layer) * @offset: absolute offset this direct mapping is pointing to * @length: length in byte of this direct mapping * @@ -237,7 +239,9 @@ struct spi_mem_op { * direction is directly encoded in the ->op_tmpl.data.dir field. */ struct spi_mem_dirmap_info { - struct spi_mem_op op_tmpl; + struct spi_mem_op *op_tmpl; + struct spi_mem_op primary_op_tmpl; + struct spi_mem_op secondary_op_tmpl; u64 offset; u64 length; }; @@ -381,12 +385,19 @@ struct spi_controller_mem_ops { * @swap16: Supports swapping bytes on a 16 bit boundary when configured in * Octal DTR * @per_op_freq: Supports per operation frequency switching + * @secondary_op_tmpl: Supports leveraging a secondary memory operation template + * @no_cs_assertion: The controller may automatically deassert the CS if there + * is a pause in the transfer (eg. internal bus contention or + * DMA arbitration on an interconnect). Features such as NAND + * continuous reads shall not be leveraged. */ struct spi_controller_mem_caps { bool dtr; bool ecc; bool swap16; bool per_op_freq; + bool secondary_op_tmpl; + bool no_cs_assertion; }; #define spi_mem_controller_is_capable(ctlr, cap) \ diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 79513f5941cc..f6ed93eff00b 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -424,7 +424,6 @@ extern struct spi_device *devm_spi_new_ancillary_device(struct spi_device *spi, * @flags: other constraints relevant to this driver * @slave: indicates that this is an SPI slave controller * @target: indicates that this is an SPI target controller - * @devm_allocated: whether the allocation of this struct is devres-managed * @max_transfer_size: function that returns the max transfer size for * a &spi_device; may be %NULL, so the default %SIZE_MAX will be used. * @max_message_size: function that returns the max message size for @@ -629,9 +628,6 @@ struct spi_controller { */ #define SPI_CONTROLLER_MULTI_CS BIT(7) - /* Flag indicating if the allocation of this struct is devres-managed */ - bool devm_allocated; - union { /* Flag indicating this is an SPI slave controller */ bool slave; diff --git a/include/trace/events/qcom_geni_spi.h b/include/trace/events/qcom_geni_spi.h new file mode 100644 index 000000000000..6d027adf2e1d --- /dev/null +++ b/include/trace/events/qcom_geni_spi.h @@ -0,0 +1,103 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM qcom_geni_spi + +#if !defined(_TRACE_QCOM_GENI_SPI_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_QCOM_GENI_SPI_H + +#include <linux/tracepoint.h> + +TRACE_EVENT(geni_spi_setup_params, + TP_PROTO(struct device *dev, u8 cs, u32 mode, + u32 mode_changed, bool cs_changed), + TP_ARGS(dev, cs, mode, mode_changed, cs_changed), + + TP_STRUCT__entry(__string(name, dev_name(dev)) + __field(u8, cs) + __field(u32, mode) + __field(u32, mode_changed) + __field(bool, cs_changed) + ), + + TP_fast_assign(__assign_str(name); + __entry->cs = cs; + __entry->mode = mode; + __entry->mode_changed = mode_changed; + __entry->cs_changed = cs_changed; + ), + + TP_printk("%s: cs=%u mode=0x%08x mode_changed=0x%08x cs_changed=%d", + __get_str(name), __entry->cs, __entry->mode, + __entry->mode_changed, __entry->cs_changed) +); + +TRACE_EVENT(geni_spi_clk_cfg, + TP_PROTO(struct device *dev, unsigned long req_hz, + unsigned long sclk_hz, unsigned int clk_idx, + unsigned int clk_div, unsigned int bpw), + TP_ARGS(dev, req_hz, sclk_hz, clk_idx, clk_div, bpw), + + TP_STRUCT__entry(__string(name, dev_name(dev)) + __field(unsigned long, req_hz) + __field(unsigned long, sclk_hz) + __field(unsigned int, clk_idx) + __field(unsigned int, clk_div) + __field(unsigned int, bpw) + ), + + TP_fast_assign(__assign_str(name); + __entry->req_hz = req_hz; + __entry->sclk_hz = sclk_hz; + __entry->clk_idx = clk_idx; + __entry->clk_div = clk_div; + __entry->bpw = bpw; + ), + + TP_printk("%s: req_hz=%lu sclk_hz=%lu clk_idx=%u clk_div=%u bpw=%u", + __get_str(name), __entry->req_hz, __entry->sclk_hz, + __entry->clk_idx, __entry->clk_div, __entry->bpw) +); + +TRACE_EVENT(geni_spi_transfer, + TP_PROTO(struct device *dev, unsigned int len, u32 m_cmd), + TP_ARGS(dev, len, m_cmd), + + TP_STRUCT__entry(__string(name, dev_name(dev)) + __field(unsigned int, len) + __field(u32, m_cmd) + ), + + TP_fast_assign(__assign_str(name); + __entry->len = len; + __entry->m_cmd = m_cmd; + ), + + TP_printk("%s: len=%u m_cmd=0x%08x", + __get_str(name), __entry->len, __entry->m_cmd) +); + +TRACE_EVENT(geni_spi_irq, + TP_PROTO(struct device *dev, u32 m_irq, u32 dma_tx, u32 dma_rx), + TP_ARGS(dev, m_irq, dma_tx, dma_rx), + + TP_STRUCT__entry(__string(name, dev_name(dev)) + __field(u32, m_irq) + __field(u32, dma_tx) + __field(u32, dma_rx) + ), + + TP_fast_assign(__assign_str(name); + __entry->m_irq = m_irq; + __entry->dma_tx = dma_tx; + __entry->dma_rx = dma_rx; + ), + + TP_printk("%s: m_irq=0x%08x dma_tx=0x%08x dma_rx=0x%08x", + __get_str(name), __entry->m_irq, __entry->dma_tx, + __entry->dma_rx) +); + +#endif /* _TRACE_QCOM_GENI_SPI_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> |
