linux/drivers/net/dsa/hirschmann/hellcreek_ptp.c

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * DSA driver for:
 * Hirschmann Hellcreek TSN switch.
 *
 * Copyright (C) 2019,2020 Hochschule Offenburg
 * Copyright (C) 2019,2020 Linutronix GmbH
 * Authors: Kamil Alkhouri <[email protected]>
 *	    Kurt Kanzenbach <[email protected]>
 */

#include <linux/of.h>
#include <linux/ptp_clock_kernel.h>
#include "hellcreek.h"
#include "hellcreek_ptp.h"
#include "hellcreek_hwtstamp.h"

u16 hellcreek_ptp_read(struct hellcreek *hellcreek, unsigned int offset)
{}

void hellcreek_ptp_write(struct hellcreek *hellcreek, u16 data,
			 unsigned int offset)
{}

/* Get nanoseconds from PTP clock */
static u64 hellcreek_ptp_clock_read(struct hellcreek *hellcreek,
				    struct ptp_system_timestamp *sts)
{}

static u64 __hellcreek_ptp_gettime(struct hellcreek *hellcreek,
				   struct ptp_system_timestamp *sts)
{}

/* Retrieve the seconds parts in nanoseconds for a packet timestamped with @ns.
 * There has to be a check whether an overflow occurred between the packet
 * arrival and now. If so use the correct seconds (-1) for calculating the
 * packet arrival time.
 */
u64 hellcreek_ptp_gettime_seconds(struct hellcreek *hellcreek, u64 ns)
{}

static int hellcreek_ptp_gettimex(struct ptp_clock_info *ptp,
				  struct timespec64 *ts,
				  struct ptp_system_timestamp *sts)
{}

static int hellcreek_ptp_settime(struct ptp_clock_info *ptp,
				 const struct timespec64 *ts)
{}

static int hellcreek_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
{}

static int hellcreek_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{}

static int hellcreek_ptp_enable(struct ptp_clock_info *ptp,
				struct ptp_clock_request *rq, int on)
{}

static void hellcreek_ptp_overflow_check(struct work_struct *work)
{}

static enum led_brightness hellcreek_get_brightness(struct hellcreek *hellcreek,
						    int led)
{}

static void hellcreek_set_brightness(struct hellcreek *hellcreek, int led,
				     enum led_brightness b)
{}

static void hellcreek_led_sync_good_set(struct led_classdev *ldev,
					enum led_brightness b)
{}

static enum led_brightness hellcreek_led_sync_good_get(struct led_classdev *ldev)
{}

static void hellcreek_led_is_gm_set(struct led_classdev *ldev,
				    enum led_brightness b)
{}

static enum led_brightness hellcreek_led_is_gm_get(struct led_classdev *ldev)
{}

/* There two available LEDs internally called sync_good and is_gm. However, the
 * user might want to use a different label and specify the default state. Take
 * those properties from device tree.
 */
static int hellcreek_led_setup(struct hellcreek *hellcreek)
{}

int hellcreek_ptp_setup(struct hellcreek *hellcreek)
{}

void hellcreek_ptp_free(struct hellcreek *hellcreek)
{}