Commit f702dbbb authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'linux-can-next-for-6.6-20230803' of...

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



Marc Kleine-Budde says:

====================
pull-request: can-next 2023-08-03

This is a pull request of 9 patches for net-next/master.

The 1st patch is by Ruan Jinjie, targets the flexcan driver, and
cleans up the error handling of platform_get_irq() in the
flexcan_probe() function.

Markus Schneider-Pargmann contributes 6 patches for the tcan4x5x M_CAN
driver, consisting of some cleanups, and adding support for the
tcan4552/4553 chips.

Another patch by Ruan Jinjie, that cleans up the error path of
platform_get_irq() in the c_can_plat_probe() function of the C_CAN
platform driver.

The last patch is by Frank Jungclaus and adds support for the
CAN-USB/3 and CAN FD to the ESD USB CAN driver.
================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 992725ff 806e95ae
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
This file provides device node information for the TCAN4x5x interface contains.

Required properties:
	- compatible: "ti,tcan4x5x"
	- compatible:
		"ti,tcan4552", "ti,tcan4x5x"
		"ti,tcan4553", "ti,tcan4x5x" or
		"ti,tcan4x5x"
	- reg: 0
	- #address-cells: 1
	- #size-cells: 0
@@ -21,8 +24,10 @@ Optional properties:
	- reset-gpios: Hardwired output GPIO. If not defined then software
		       reset.
	- device-state-gpios: Input GPIO that indicates if the device is in
			      a sleep state or if the device is active.
	- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
			      a sleep state or if the device is active. Not
			      available with tcan4552/4553.
	- device-wake-gpios: Wake up GPIO to wake up the TCAN device. Not
			     available with tcan4552/4553.

Example:
tcan4x5x: tcan4x5x@0 {
+2 −2
Original line number Diff line number Diff line
@@ -285,8 +285,8 @@ static int c_can_plat_probe(struct platform_device *pdev)

	/* get the platform data */
	irq = platform_get_irq(pdev, 0);
	if (irq <= 0) {
		ret = -ENODEV;
	if (irq < 0) {
		ret = irq;
		goto exit;
	}

+6 −6
Original line number Diff line number Diff line
@@ -2089,8 +2089,8 @@ static int flexcan_probe(struct platform_device *pdev)
	}

	irq = platform_get_irq(pdev, 0);
	if (irq <= 0)
		return -ENODEV;
	if (irq < 0)
		return irq;

	regs = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(regs))
@@ -2167,13 +2167,13 @@ static int flexcan_probe(struct platform_device *pdev)

	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
		priv->irq_boff = platform_get_irq(pdev, 1);
		if (priv->irq_boff <= 0) {
			err = -ENODEV;
		if (priv->irq_boff < 0) {
			err = priv->irq_boff;
			goto failed_platform_get_irq;
		}
		priv->irq_err = platform_get_irq(pdev, 2);
		if (priv->irq_err <= 0) {
			err = -ENODEV;
		if (priv->irq_err < 0) {
			err = priv->irq_err;
			goto failed_platform_get_irq;
		}
	}
+16 −0
Original line number Diff line number Diff line
@@ -1913,6 +1913,22 @@ static int register_m_can_dev(struct net_device *dev)
	return register_candev(dev);
}

int m_can_check_mram_cfg(struct m_can_classdev *cdev, u32 mram_max_size)
{
	u32 total_size;

	total_size = cdev->mcfg[MRAM_TXB].off - cdev->mcfg[MRAM_SIDF].off +
			cdev->mcfg[MRAM_TXB].num * TXB_ELEMENT_SIZE;
	if (total_size > mram_max_size) {
		dev_err(cdev->dev, "Total size of mram config(%u) exceeds mram(%u)\n",
			total_size, mram_max_size);
		return -EINVAL;
	}

	return 0;
}
EXPORT_SYMBOL_GPL(m_can_check_mram_cfg);

static void m_can_of_parse_mram(struct m_can_classdev *cdev,
				const u32 *mram_config_vals)
{
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ int m_can_class_register(struct m_can_classdev *cdev);
void m_can_class_unregister(struct m_can_classdev *cdev);
int m_can_class_get_clocks(struct m_can_classdev *cdev);
int m_can_init_ram(struct m_can_classdev *priv);
int m_can_check_mram_cfg(struct m_can_classdev *cdev, u32 mram_max_size);

int m_can_class_suspend(struct device *dev);
int m_can_class_resume(struct device *dev);
Loading