Commit cb7fb043 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'linux-can-next-for-5.11-20201130' of...

Merge tag 'linux-can-next-for-5.11-20201130' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2020-11-30

Gustavo A. R. Silva's patch for the pcan_usb driver fixes fall-through warnings
for Clang.

The next 5 patches target the mcp251xfd driver and are by Ursula Maplehurst and
me. They optimizie the TEF and RX path by reducing number of SPI core requests
to set the UINC bit.

The remaining 8 patches target the m_can driver. The first 4 are various
cleanups for the SPI binding driver (tcan4x5x) by Sean Nyekjaer, Dan Murphy and
me. Followed by 4 cleanup patches by me for the m_can and m_can_platform
driver.

* tag 'linux-can-next-for-5.11-20201130' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: m_can: m_can_class_unregister(): move right after m_can_class_register()
  can: m_can: m_can_plat_remove(): remove unneeded platform_set_drvdata()
  can: m_can: remove not used variable struct m_can_classdev::freq
  can: m_can: Kconfig: convert the into menu
  can: tcan4x5x: tcan4x5x_can_probe(): remove probe failed error message
  can: tcan4x5x: remove mram_start and reg_offset from struct tcan4x5x_priv
  can: tcan4x5x: rename parse_config() function
  can: tcan4x5x: tcan4x5x_clear_interrupts(): remove redundant return statement
  can: mcp251xfd: tef-path: reduce number of SPI core requests to set UINC bit
  can: mcp251xfd: move struct mcp251xfd_tef_ring definition
  can: mcp251xfd: struct mcp251xfd_priv::tef to array of length 1
  can: mcp25xxfd: rx-path: reduce number of SPI core requests to set UINC bit
  can: mcp251xfd: mcp25xxfd_ring_alloc(): add define instead open coding the maximum number of RX objects
  can: pcan_usb_core: fix fall-through warnings for Clang
====================

Link: https://lore.kernel.org/r/20201130141432.278219-1-mkl@pengutronix.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 76810ed8 6d9986b4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config CAN_M_CAN
menuconfig CAN_M_CAN
	tristate "Bosch M_CAN support"
	help
	  Say Y here if you want support for Bosch M_CAN controller framework.
	  This is common support for devices that embed the Bosch M_CAN IP.

if CAN_M_CAN

config CAN_M_CAN_PLATFORM
	tristate "Bosch M_CAN support for io-mapped devices"
	depends on HAS_IOMEM
	depends on CAN_M_CAN
	help
	  Say Y here if you want support for IO Mapped Bosch M_CAN controller.
	  This support is for devices that have the Bosch M_CAN controller
	  IP embedded into the device and the IP is IO Mapped to the processor.

config CAN_M_CAN_TCAN4X5X
	depends on CAN_M_CAN
	depends on SPI
	select REGMAP_SPI
	tristate "TCAN4X5X M_CAN device"
@@ -23,3 +23,5 @@ config CAN_M_CAN_TCAN4X5X
	  Say Y here if you want support for Texas Instruments TCAN4x5x
	  M_CAN controller.  This device is a peripheral device that uses the
	  SPI bus for communication.

endif
+8 −8
Original line number Diff line number Diff line
@@ -1869,6 +1869,14 @@ int m_can_class_register(struct m_can_classdev *m_can_dev)
}
EXPORT_SYMBOL_GPL(m_can_class_register);

void m_can_class_unregister(struct m_can_classdev *m_can_dev)
{
	unregister_candev(m_can_dev->net);

	m_can_clk_stop(m_can_dev);
}
EXPORT_SYMBOL_GPL(m_can_class_unregister);

int m_can_class_suspend(struct device *dev)
{
	struct net_device *ndev = dev_get_drvdata(dev);
@@ -1915,14 +1923,6 @@ int m_can_class_resume(struct device *dev)
}
EXPORT_SYMBOL_GPL(m_can_class_resume);

void m_can_class_unregister(struct m_can_classdev *m_can_dev)
{
	unregister_candev(m_can_dev->net);

	m_can_clk_stop(m_can_dev);
}
EXPORT_SYMBOL_GPL(m_can_class_unregister);

MODULE_AUTHOR("Dong Aisheng <b29396@freescale.com>");
MODULE_AUTHOR("Dan Murphy <dmurphy@ti.com>");
MODULE_LICENSE("GPL v2");
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ struct m_can_classdev {
	void *device_data;

	int version;
	int freq;
	u32 irqstatus;

	int pm_clock_support;
+0 −2
Original line number Diff line number Diff line
@@ -141,8 +141,6 @@ static int m_can_plat_remove(struct platform_device *pdev)

	m_can_class_free_dev(mcan_class->net);

	platform_set_drvdata(pdev, NULL);

	return 0;
}

+8 −20
Original line number Diff line number Diff line
@@ -123,10 +123,6 @@ struct tcan4x5x_priv {
	struct gpio_desc *device_wake_gpio;
	struct gpio_desc *device_state_gpio;
	struct regulator *power;

	/* Register based ip */
	int mram_start;
	int reg_offset;
};

static struct can_bittiming_const tcan4x5x_bittiming_const = {
@@ -260,7 +256,7 @@ static u32 tcan4x5x_read_reg(struct m_can_classdev *cdev, int reg)
	struct tcan4x5x_priv *priv = cdev->device_data;
	u32 val;

	regmap_read(priv->regmap, priv->reg_offset + reg, &val);
	regmap_read(priv->regmap, TCAN4X5X_MCAN_OFFSET + reg, &val);

	return val;
}
@@ -270,7 +266,7 @@ static u32 tcan4x5x_read_fifo(struct m_can_classdev *cdev, int addr_offset)
	struct tcan4x5x_priv *priv = cdev->device_data;
	u32 val;

	regmap_read(priv->regmap, priv->mram_start + addr_offset, &val);
	regmap_read(priv->regmap, TCAN4X5X_MRAM_START + addr_offset, &val);

	return val;
}
@@ -279,7 +275,7 @@ static int tcan4x5x_write_reg(struct m_can_classdev *cdev, int reg, int val)
{
	struct tcan4x5x_priv *priv = cdev->device_data;

	return regmap_write(priv->regmap, priv->reg_offset + reg, val);
	return regmap_write(priv->regmap, TCAN4X5X_MCAN_OFFSET + reg, val);
}

static int tcan4x5x_write_fifo(struct m_can_classdev *cdev,
@@ -287,7 +283,7 @@ static int tcan4x5x_write_fifo(struct m_can_classdev *cdev,
{
	struct tcan4x5x_priv *priv = cdev->device_data;

	return regmap_write(priv->regmap, priv->mram_start + addr_offset, val);
	return regmap_write(priv->regmap, TCAN4X5X_MRAM_START + addr_offset, val);
}

static int tcan4x5x_power_enable(struct regulator *reg, int enable)
@@ -328,12 +324,8 @@ static int tcan4x5x_clear_interrupts(struct m_can_classdev *cdev)
	if (ret)
		return ret;

	ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS,
	return tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS,
				       TCAN4X5X_CLEAR_ALL_INT);
	if (ret)
		return ret;

	return ret;
}

static int tcan4x5x_init(struct m_can_classdev *cdev)
@@ -379,7 +371,7 @@ static int tcan4x5x_disable_state(struct m_can_classdev *cdev)
				  TCAN4X5X_DISABLE_INH_MSK, 0x01);
}

static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
static int tcan4x5x_get_gpios(struct m_can_classdev *cdev)
{
	struct tcan4x5x_priv *tcan4x5x = cdev->device_data;
	int ret;
@@ -469,8 +461,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
		goto out_m_can_class_free_dev;
	}

	priv->reg_offset = TCAN4X5X_MCAN_OFFSET;
	priv->mram_start = TCAN4X5X_MRAM_START;
	priv->spi = spi;
	priv->mcan_dev = mcan_class;

@@ -502,7 +492,7 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
	if (ret)
		goto out_clk;

	ret = tcan4x5x_parse_config(mcan_class);
	ret = tcan4x5x_get_gpios(mcan_class);
	if (ret)
		goto out_power;

@@ -526,8 +516,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
	}
 out_m_can_class_free_dev:
	m_can_class_free_dev(mcan_class->net);
	dev_err(&spi->dev, "Probe failed, err=%d\n", ret);

	return ret;
}

Loading