mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
net: dsa: microchip: Wrap timestamp reading in a function
Timestamps are directly accessed through a register read in the interrupt handler. KSZ8463's logic to access it will be a bit more complex because the same interrupt can be triggered by two different timestamps being ready. Wrap the timestamp's reading in a dedicated function to ease the KSZ8463's integration in upcoming patches. Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20260105-ksz-rework-v1-9-a68df7f57375@bootlin.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
b4df828dfc
commit
3adff276e7
|
|
@ -967,6 +967,11 @@ void ksz_ptp_clock_unregister(struct dsa_switch *ds)
|
|||
ptp_clock_unregister(ptp_data->clock);
|
||||
}
|
||||
|
||||
static int ksz_read_ts(struct ksz_port *port, u16 reg, u32 *ts)
|
||||
{
|
||||
return ksz_read32(port->ksz_dev, reg, ts);
|
||||
}
|
||||
|
||||
static irqreturn_t ksz_ptp_msg_thread_fn(int irq, void *dev_id)
|
||||
{
|
||||
struct ksz_ptp_irq *ptpmsg_irq = dev_id;
|
||||
|
|
@ -980,7 +985,7 @@ static irqreturn_t ksz_ptp_msg_thread_fn(int irq, void *dev_id)
|
|||
dev = port->ksz_dev;
|
||||
|
||||
if (ptpmsg_irq->ts_en) {
|
||||
ret = ksz_read32(dev, ptpmsg_irq->ts_reg, &tstamp_raw);
|
||||
ret = ksz_read_ts(port, ptpmsg_irq->ts_reg, &tstamp_raw);
|
||||
if (ret)
|
||||
return IRQ_NONE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user