Commit b63945b0 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge tag 'linux-can-next-for-6.19-20251112-2' of...

Merge tag 'linux-can-next-for-6.19-20251112-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2025-11-12

this is a pull request of 11 patches for net-next/main.

The first 3 patches are by Vadim Fedorenko and convert the CAN drivers
to use the ndo_hwtstamp callbacks.

Maud Spierings contributes a patch for the mcp251x driver that
converts it to use dev_err_probe().

The next 6 patches target the mcp251xfd driver and are by Gregor
Herburger and me. They add GPIO controller functionality to the
driver.

The final patch is by Chu Guangqing and fixes a typo in the bxcan
driver.

linux-can-next-for-6.19-20251112-2

* tag 'linux-can-next-for-6.19-20251112-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: bxcan: Fix a typo error for assign
  dt-bindings: can: mcp251xfd: add gpio-controller property
  can: mcp251xfd: add gpio functionality
  can: mcp251xfd: only configure PIN1 when rx_int is set
  can: mcp251xfd: add workaround for errata 5
  can: mcp251xfd: utilize gather_write function for all non-CRC writes
  can: mcp251xfd: move chip sleep mode into runtime pm
  can: mcp251x: mcp251x_can_probe(): use dev_err_probe()
  can: peak_usb: convert to use ndo_hwtstamp callbacks
  can: peak_canfd: convert to use ndo_hwtstamp callbacks
  can: convert generic HW timestamp ioctl to ndo_hwtstamp callbacks
====================

Link: https://patch.msgid.link/20251112184344.189863-1-mkl@pengutronix.de


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 68fa5b09 b305fbda
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ properties:
      Must be half or less of "clocks" frequency.
    maximum: 20000000

  gpio-controller: true

  "#gpio-cells":
    const: 2

required:
  - compatible
  - reg
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ static void bxcan_enable_filters(struct bxcan_priv *priv, enum bxcan_cfg cfg)
	 * mask mode with 32 bits width.
	 */

	/* Enter filter initialization mode and assing filters to CAN
	/* Enter filter initialization mode and assign filters to CAN
	 * controllers.
	 */
	regmap_update_bits(priv->gcan, BXCAN_FMR_REG,
+22 −23
Original line number Diff line number Diff line
@@ -379,34 +379,33 @@ int can_set_static_ctrlmode(struct net_device *dev, u32 static_mode)
}
EXPORT_SYMBOL_GPL(can_set_static_ctrlmode);

/* generic implementation of netdev_ops::ndo_eth_ioctl for CAN devices
/* generic implementation of netdev_ops::ndo_hwtstamp_get for CAN devices
 * supporting hardware timestamps
 */
int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd)
int can_hwtstamp_get(struct net_device *netdev,
		     struct kernel_hwtstamp_config *cfg)
{
	struct hwtstamp_config hwts_cfg = { 0 };

	switch (cmd) {
	case SIOCSHWTSTAMP: /* set */
		if (copy_from_user(&hwts_cfg, ifr->ifr_data, sizeof(hwts_cfg)))
			return -EFAULT;
		if (hwts_cfg.tx_type == HWTSTAMP_TX_ON &&
		    hwts_cfg.rx_filter == HWTSTAMP_FILTER_ALL)
			return 0;
		return -ERANGE;
	cfg->tx_type = HWTSTAMP_TX_ON;
	cfg->rx_filter = HWTSTAMP_FILTER_ALL;

	case SIOCGHWTSTAMP: /* get */
		hwts_cfg.tx_type = HWTSTAMP_TX_ON;
		hwts_cfg.rx_filter = HWTSTAMP_FILTER_ALL;
		if (copy_to_user(ifr->ifr_data, &hwts_cfg, sizeof(hwts_cfg)))
			return -EFAULT;
	return 0;

	default:
		return -EOPNOTSUPP;
}
EXPORT_SYMBOL(can_hwtstamp_get);

/* generic implementation of netdev_ops::ndo_hwtstamp_set for CAN devices
 * supporting hardware timestamps
 */
int can_hwtstamp_set(struct net_device *netdev,
		     struct kernel_hwtstamp_config *cfg,
		     struct netlink_ext_ack *extack)
{
	if (cfg->tx_type == HWTSTAMP_TX_ON &&
	    cfg->rx_filter == HWTSTAMP_FILTER_ALL)
		return 0;
	NL_SET_ERR_MSG_MOD(extack, "Only TX on and RX all packets filter supported");
	return -ERANGE;
}
EXPORT_SYMBOL(can_eth_ioctl_hwts);
EXPORT_SYMBOL(can_hwtstamp_set);

/* generic implementation of ethtool_ops::get_ts_info for CAN devices
 * supporting hardware timestamps
+2 −1
Original line number Diff line number Diff line
@@ -86,7 +86,8 @@ static const struct net_device_ops pci402_acc_netdev_ops = {
	.ndo_open = acc_open,
	.ndo_stop = acc_close,
	.ndo_start_xmit = acc_start_xmit,
	.ndo_eth_ioctl = can_eth_ioctl_hwts,
	.ndo_hwtstamp_get = can_hwtstamp_get,
	.ndo_hwtstamp_set = can_hwtstamp_set,
};

static const struct ethtool_ops pci402_acc_ethtool_ops = {
+2 −1
Original line number Diff line number Diff line
@@ -902,8 +902,9 @@ static void kvaser_pciefd_bec_poll_timer(struct timer_list *data)
static const struct net_device_ops kvaser_pciefd_netdev_ops = {
	.ndo_open = kvaser_pciefd_open,
	.ndo_stop = kvaser_pciefd_stop,
	.ndo_eth_ioctl = can_eth_ioctl_hwts,
	.ndo_start_xmit = kvaser_pciefd_start_xmit,
	.ndo_hwtstamp_get = can_hwtstamp_get,
	.ndo_hwtstamp_set = can_hwtstamp_set,
};

static int kvaser_pciefd_set_phys_id(struct net_device *netdev,
Loading