Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2d5eda0 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl',...

Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/lantiq' into spi-next
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,12 @@ See the clock consumer binding,
Obsolete properties:
- fsl,spi-num-chipselects : Contains the number of the chipselect

Optional properties:
- fsl,spi-rdy-drctl: Integer, representing the value of DRCTL, the register
controlling the SPI_READY handling. Note that to enable the DRCTL consideration,
the SPI_READY mode-flag needs to be set too.
Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst).

Example:

ecspi@70010000 {
@@ -35,4 +41,5 @@ ecspi@70010000 {
		   <&gpio3 25 0>; /* GPIO3_25 */
	dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
	dma-names = "rx", "tx";
	fsl,spi-rdy-drctl = <1>;
};
+2 −1
Original line number Diff line number Diff line
@@ -1002,7 +1002,8 @@ static int dspi_probe(struct platform_device *pdev)
	if (IS_ERR(dspi->regmap)) {
		dev_err(&pdev->dev, "failed to init regmap: %ld\n",
				PTR_ERR(dspi->regmap));
		return PTR_ERR(dspi->regmap);
		ret = PTR_ERR(dspi->regmap);
		goto out_master_put;
	}

	dspi_init(dspi);
+2 −1
Original line number Diff line number Diff line
@@ -814,7 +814,7 @@ static int of_fsl_spi_probe(struct platform_device *ofdev)
	struct device_node *np = ofdev->dev.of_node;
	struct spi_master *master;
	struct resource mem;
	int irq, type;
	int irq = 0, type;
	int ret = -ENOMEM;

	ret = of_mpc8xxx_spi_probe(ofdev);
@@ -847,6 +847,7 @@ static int of_fsl_spi_probe(struct platform_device *ofdev)
	return 0;

err:
	irq_dispose_mapping(irq);
	if (type == TYPE_FSL)
		of_fsl_spi_free_chipselects(dev);
	return ret;
+18 −2
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ struct spi_imx_data {
	unsigned int spi_bus_clk;

	unsigned int bytes_per_word;
	unsigned int spi_drctl;

	unsigned int count;
	void (*tx)(struct spi_imx_data *);
@@ -246,6 +247,7 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
#define MX51_ECSPI_CTRL_XCH		(1 <<  2)
#define MX51_ECSPI_CTRL_SMC		(1 << 3)
#define MX51_ECSPI_CTRL_MODE_MASK	(0xf << 4)
#define MX51_ECSPI_CTRL_DRCTL(drctl)	((drctl) << 16)
#define MX51_ECSPI_CTRL_POSTDIV_OFFSET	8
#define MX51_ECSPI_CTRL_PREDIV_OFFSET	12
#define MX51_ECSPI_CTRL_CS(cs)		((cs) << 18)
@@ -355,6 +357,12 @@ static int mx51_ecspi_config(struct spi_device *spi,
	 */
	ctrl |= MX51_ECSPI_CTRL_MODE_MASK;

	/*
	 * Enable SPI_RDY handling (falling edge/level triggered).
	 */
	if (spi->mode & SPI_READY)
		ctrl |= MX51_ECSPI_CTRL_DRCTL(spi_imx->spi_drctl);

	/* set clock speed */
	ctrl |= mx51_ecspi_clkdiv(spi_imx, config->speed_hz, &clk);
	spi_imx->spi_bus_clk = clk;
@@ -1173,7 +1181,7 @@ static int spi_imx_probe(struct platform_device *pdev)
	struct spi_master *master;
	struct spi_imx_data *spi_imx;
	struct resource *res;
	int i, ret, irq;
	int i, ret, irq, spi_drctl;

	if (!np && !mxc_platform_info) {
		dev_err(&pdev->dev, "can't get the platform data\n");
@@ -1181,6 +1189,12 @@ static int spi_imx_probe(struct platform_device *pdev)
	}

	master = spi_alloc_master(&pdev->dev, sizeof(struct spi_imx_data));
	ret = of_property_read_u32(np, "fsl,spi-rdy-drctl", &spi_drctl);
	if ((ret < 0) || (spi_drctl >= 0x3)) {
		/* '11' is reserved */
		spi_drctl = 0;
	}

	if (!master)
		return -ENOMEM;

@@ -1216,7 +1230,9 @@ static int spi_imx_probe(struct platform_device *pdev)
	spi_imx->bitbang.master->unprepare_message = spi_imx_unprepare_message;
	spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
	if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx))
		spi_imx->bitbang.master->mode_bits |= SPI_LOOP;
		spi_imx->bitbang.master->mode_bits |= SPI_LOOP | SPI_READY;

	spi_imx->spi_drctl = spi_drctl;

	init_completion(&spi_imx->xfer_done);

+0 −1
Original line number Diff line number Diff line
@@ -977,7 +977,6 @@ static struct platform_driver lantiq_ssc_driver = {
	.remove = lantiq_ssc_remove,
	.driver = {
		.name = "spi-lantiq-ssc",
		.owner = THIS_MODULE,
		.of_match_table = lantiq_ssc_match,
	},
};
Loading