#include <linux/bits.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/serial_8250.h>
#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <linux/platform_data/i2c-xiic.h>
#include <linux/platform_data/i2c-ocores.h>
#include <linux/ptp_clock_kernel.h>
#include <linux/spi/spi.h>
#include <linux/spi/xilinx_spi.h>
#include <linux/spi/altera.h>
#include <net/devlink.h>
#include <linux/i2c.h>
#include <linux/mtd/mtd.h>
#include <linux/nvmem-consumer.h>
#include <linux/crc16.h>
#include <linux/dpll.h>
#define PCI_VENDOR_ID_FACEBOOK …
#define PCI_DEVICE_ID_FACEBOOK_TIMECARD …
#define PCI_VENDOR_ID_CELESTICA …
#define PCI_DEVICE_ID_CELESTICA_TIMECARD …
#define PCI_VENDOR_ID_OROLIA …
#define PCI_DEVICE_ID_OROLIA_ARTCARD …
#define PCI_VENDOR_ID_ADVA …
#define PCI_DEVICE_ID_ADVA_TIMECARD …
static struct class timecard_class = …;
struct ocp_reg { … };
struct ptp_ocp_servo_conf { … };
#define OCP_CTRL_ENABLE …
#define OCP_CTRL_ADJUST_TIME …
#define OCP_CTRL_ADJUST_OFFSET …
#define OCP_CTRL_ADJUST_DRIFT …
#define OCP_CTRL_ADJUST_SERVO …
#define OCP_CTRL_READ_TIME_REQ …
#define OCP_CTRL_READ_TIME_DONE …
#define OCP_STATUS_IN_SYNC …
#define OCP_STATUS_IN_HOLDOVER …
#define OCP_SELECT_CLK_NONE …
#define OCP_SELECT_CLK_REG …
struct tod_reg { … };
#define TOD_CTRL_PROTOCOL …
#define TOD_CTRL_DISABLE_FMT_A …
#define TOD_CTRL_DISABLE_FMT_B …
#define TOD_CTRL_ENABLE …
#define TOD_CTRL_GNSS_MASK …
#define TOD_CTRL_GNSS_SHIFT …
#define TOD_STATUS_UTC_MASK …
#define TOD_STATUS_UTC_VALID …
#define TOD_STATUS_LEAP_ANNOUNCE …
#define TOD_STATUS_LEAP_VALID …
struct ts_reg { … };
struct pps_reg { … };
#define PPS_STATUS_FILTER_ERR …
#define PPS_STATUS_SUPERV_ERR …
struct img_reg { … };
struct gpio_reg { … };
struct irig_master_reg { … };
#define IRIG_M_CTRL_ENABLE …
struct irig_slave_reg { … };
#define IRIG_S_CTRL_ENABLE …
struct dcf_master_reg { … };
#define DCF_M_CTRL_ENABLE …
struct dcf_slave_reg { … };
#define DCF_S_CTRL_ENABLE …
struct signal_reg { … };
struct frequency_reg { … };
struct board_config_reg { … };
#define FREQ_STATUS_VALID …
#define FREQ_STATUS_ERROR …
#define FREQ_STATUS_OVERRUN …
#define FREQ_STATUS_MASK …
struct ptp_ocp_flash_info { … };
struct ptp_ocp_firmware_header { … };
#define OCP_FIRMWARE_MAGIC_HEADER …
struct ptp_ocp_i2c_info { … };
struct ptp_ocp_ext_info { … };
struct ptp_ocp_ext_src { … };
enum ptp_ocp_sma_mode { … };
static struct dpll_pin_frequency ptp_ocp_sma_freq[] = …;
struct ptp_ocp_sma_connector { … };
struct ocp_attr_group { … };
#define OCP_CAP_BASIC …
#define OCP_CAP_SIGNAL …
#define OCP_CAP_FREQ …
struct ptp_ocp_signal { … };
struct ptp_ocp_serial_port { … };
#define OCP_BOARD_ID_LEN …
#define OCP_SERIAL_LEN …
#define OCP_SMA_NUM …
struct ptp_ocp { … };
#define OCP_REQ_TIMESTAMP …
#define OCP_REQ_PPS …
struct ocp_resource { … };
static int ptp_ocp_register_mem(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_register_i2c(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_register_spi(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_register_serial(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_register_ext(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_fb_board_init(struct ptp_ocp *bp, struct ocp_resource *r);
static irqreturn_t ptp_ocp_ts_irq(int irq, void *priv);
static irqreturn_t ptp_ocp_signal_irq(int irq, void *priv);
static int ptp_ocp_ts_enable(void *priv, u32 req, bool enable);
static int ptp_ocp_signal_from_perout(struct ptp_ocp *bp, int gen,
struct ptp_perout_request *req);
static int ptp_ocp_signal_enable(void *priv, u32 req, bool enable);
static int ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr);
static int ptp_ocp_art_board_init(struct ptp_ocp *bp, struct ocp_resource *r);
static int ptp_ocp_adva_board_init(struct ptp_ocp *bp, struct ocp_resource *r);
static const struct ocp_attr_group fb_timecard_groups[];
static const struct ocp_attr_group art_timecard_groups[];
static const struct ocp_attr_group adva_timecard_groups[];
struct ptp_ocp_eeprom_map { … };
#define EEPROM_ENTRY(addr, member) …
#define BP_MAP_ENTRY_ADDR(bp, map) …
static struct ptp_ocp_eeprom_map fb_eeprom_map[] = …;
static struct ptp_ocp_eeprom_map art_eeprom_map[] = …;
#define bp_assign_entry(bp, res, val) …
#define OCP_RES_LOCATION(member) …
#define OCP_MEM_RESOURCE(member) …
#define OCP_SERIAL_RESOURCE(member) …
#define OCP_I2C_RESOURCE(member) …
#define OCP_SPI_RESOURCE(member) …
#define OCP_EXT_RESOURCE(member) …
static struct ocp_resource ocp_fb_resource[] = …;
#define OCP_ART_CONFIG_SIZE …
#define OCP_ART_TEMP_TABLE_SIZE …
struct ocp_art_gpio_reg { … };
static struct ocp_resource ocp_art_resource[] = …;
static struct ocp_resource ocp_adva_resource[] = …;
static const struct pci_device_id ptp_ocp_pcidev_id[] = …;
MODULE_DEVICE_TABLE(pci, ptp_ocp_pcidev_id);
static DEFINE_MUTEX(ptp_ocp_lock);
static DEFINE_IDR(ptp_ocp_idr);
struct ocp_selector { … };
static const struct ocp_selector ptp_ocp_clock[] = …;
#define SMA_DISABLE …
#define SMA_ENABLE …
#define SMA_SELECT_MASK …
static const struct ocp_selector ptp_ocp_sma_in[] = …;
static const struct ocp_selector ptp_ocp_sma_out[] = …;
static const struct ocp_selector ptp_ocp_art_sma_in[] = …;
static const struct ocp_selector ptp_ocp_art_sma_out[] = …;
static const struct ocp_selector ptp_ocp_adva_sma_in[] = …;
static const struct ocp_selector ptp_ocp_adva_sma_out[] = …;
struct ocp_sma_op { … };
static void
ptp_ocp_sma_init(struct ptp_ocp *bp)
{ … }
static u32
ptp_ocp_sma_get(struct ptp_ocp *bp, int sma_nr)
{ … }
static int
ptp_ocp_sma_set_inputs(struct ptp_ocp *bp, int sma_nr, u32 val)
{ … }
static int
ptp_ocp_sma_set_output(struct ptp_ocp *bp, int sma_nr, u32 val)
{ … }
static const char *
ptp_ocp_select_name_from_val(const struct ocp_selector *tbl, int val)
{ … }
static int
ptp_ocp_select_val_from_name(const struct ocp_selector *tbl, const char *name)
{ … }
static ssize_t
ptp_ocp_select_table_show(const struct ocp_selector *tbl, char *buf)
{ … }
static int
__ptp_ocp_gettime_locked(struct ptp_ocp *bp, struct timespec64 *ts,
struct ptp_system_timestamp *sts)
{ … }
static int
ptp_ocp_gettimex(struct ptp_clock_info *ptp_info, struct timespec64 *ts,
struct ptp_system_timestamp *sts)
{ … }
static void
__ptp_ocp_settime_locked(struct ptp_ocp *bp, const struct timespec64 *ts)
{ … }
static int
ptp_ocp_settime(struct ptp_clock_info *ptp_info, const struct timespec64 *ts)
{ … }
static void
__ptp_ocp_adjtime_locked(struct ptp_ocp *bp, u32 adj_val)
{ … }
static void
ptp_ocp_adjtime_coarse(struct ptp_ocp *bp, s64 delta_ns)
{ … }
static int
ptp_ocp_adjtime(struct ptp_clock_info *ptp_info, s64 delta_ns)
{ … }
static int
ptp_ocp_null_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
{ … }
static s32
ptp_ocp_null_getmaxphase(struct ptp_clock_info *ptp_info)
{ … }
static int
ptp_ocp_null_adjphase(struct ptp_clock_info *ptp_info, s32 phase_ns)
{ … }
static int
ptp_ocp_enable(struct ptp_clock_info *ptp_info, struct ptp_clock_request *rq,
int on)
{ … }
static int
ptp_ocp_verify(struct ptp_clock_info *ptp_info, unsigned pin,
enum ptp_pin_function func, unsigned chan)
{ … }
static const struct ptp_clock_info ptp_ocp_clock_info = …;
static void
__ptp_ocp_clear_drift_locked(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_utc_distribute(struct ptp_ocp *bp, u32 val)
{ … }
static void
ptp_ocp_watchdog(struct timer_list *t)
{ … }
static void
ptp_ocp_estimate_pci_timing(struct ptp_ocp *bp)
{ … }
static int
ptp_ocp_init_clock(struct ptp_ocp *bp, struct ptp_ocp_servo_conf *servo_conf)
{ … }
static void
ptp_ocp_tod_init(struct ptp_ocp *bp)
{ … }
static const char *
ptp_ocp_tod_proto_name(const int idx)
{ … }
static const char *
ptp_ocp_tod_gnss_name(int idx)
{ … }
struct ptp_ocp_nvmem_match_info { … };
static int
ptp_ocp_nvmem_match(struct device *dev, const void *data)
{ … }
static inline struct nvmem_device *
ptp_ocp_nvmem_device_get(struct ptp_ocp *bp, const void * const tag)
{ … }
static inline void
ptp_ocp_nvmem_device_put(struct nvmem_device **nvmemp)
{ … }
static void
ptp_ocp_read_eeprom(struct ptp_ocp *bp)
{ … }
static struct device *
ptp_ocp_find_flash(struct ptp_ocp *bp)
{ … }
static int
ptp_ocp_devlink_fw_image(struct devlink *devlink, const struct firmware *fw,
const u8 **data, size_t *size)
{ … }
static int
ptp_ocp_devlink_flash(struct devlink *devlink, struct device *dev,
const struct firmware *fw)
{ … }
static int
ptp_ocp_devlink_flash_update(struct devlink *devlink,
struct devlink_flash_update_params *params,
struct netlink_ext_ack *extack)
{ … }
static int
ptp_ocp_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
struct netlink_ext_ack *extack)
{ … }
static const struct devlink_ops ptp_ocp_devlink_ops = …;
static void __iomem *
__ptp_ocp_get_mem(struct ptp_ocp *bp, resource_size_t start, int size)
{ … }
static void __iomem *
ptp_ocp_get_mem(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_register_spi(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static struct platform_device *
ptp_ocp_i2c_bus(struct pci_dev *pdev, struct ocp_resource *r, int id)
{ … }
static int
ptp_ocp_register_i2c(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static irqreturn_t
ptp_ocp_signal_irq(int irq, void *priv)
{ … }
static int
ptp_ocp_signal_set(struct ptp_ocp *bp, int gen, struct ptp_ocp_signal *s)
{ … }
static int
ptp_ocp_signal_from_perout(struct ptp_ocp *bp, int gen,
struct ptp_perout_request *req)
{ … }
static int
ptp_ocp_signal_enable(void *priv, u32 req, bool enable)
{ … }
static irqreturn_t
ptp_ocp_ts_irq(int irq, void *priv)
{ … }
static int
ptp_ocp_ts_enable(void *priv, u32 req, bool enable)
{ … }
static void
ptp_ocp_unregister_ext(struct ptp_ocp_ext_src *ext)
{ … }
static int
ptp_ocp_register_ext(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_serial_line(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_register_serial(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_register_mem(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static void
ptp_ocp_nmea_out_init(struct ptp_ocp *bp)
{ … }
static void
_ptp_ocp_signal_init(struct ptp_ocp_signal *s, struct signal_reg __iomem *reg)
{ … }
static void
ptp_ocp_signal_init(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_attr_group_del(struct ptp_ocp *bp)
{ … }
static int
ptp_ocp_attr_group_add(struct ptp_ocp *bp,
const struct ocp_attr_group *attr_tbl)
{ … }
static void
ptp_ocp_enable_fpga(u32 __iomem *reg, u32 bit, bool enable)
{ … }
static void
ptp_ocp_irig_out(struct ptp_ocp *bp, bool enable)
{ … }
static void
ptp_ocp_irig_in(struct ptp_ocp *bp, bool enable)
{ … }
static void
ptp_ocp_dcf_out(struct ptp_ocp *bp, bool enable)
{ … }
static void
ptp_ocp_dcf_in(struct ptp_ocp *bp, bool enable)
{ … }
static void
__handle_signal_outputs(struct ptp_ocp *bp, u32 val)
{ … }
static void
__handle_signal_inputs(struct ptp_ocp *bp, u32 val)
{ … }
static u32
ptp_ocp_sma_fb_get(struct ptp_ocp *bp, int sma_nr)
{ … }
static int
ptp_ocp_sma_fb_set_output(struct ptp_ocp *bp, int sma_nr, u32 val)
{ … }
static int
ptp_ocp_sma_fb_set_inputs(struct ptp_ocp *bp, int sma_nr, u32 val)
{ … }
static void
ptp_ocp_sma_fb_init(struct ptp_ocp *bp)
{ … }
static const struct ocp_sma_op ocp_fb_sma_op = …;
static const struct ocp_sma_op ocp_adva_sma_op = …;
static int
ptp_ocp_set_pins(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_fb_set_version(struct ptp_ocp *bp)
{ … }
static int
ptp_ocp_fb_board_init(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static bool
ptp_ocp_allow_irq(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_register_resources(struct ptp_ocp *bp, kernel_ulong_t driver_data)
{ … }
static void
ptp_ocp_art_sma_init(struct ptp_ocp *bp)
{ … }
static u32
ptp_ocp_art_sma_get(struct ptp_ocp *bp, int sma_nr)
{ … }
static int
ptp_ocp_art_sma_set(struct ptp_ocp *bp, int sma_nr, u32 val)
{ … }
static const struct ocp_sma_op ocp_art_sma_op = …;
static int
ptp_ocp_art_board_init(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static int
ptp_ocp_adva_board_init(struct ptp_ocp *bp, struct ocp_resource *r)
{ … }
static ssize_t
ptp_ocp_show_output(const struct ocp_selector *tbl, u32 val, char *buf,
int def_val)
{ … }
static ssize_t
ptp_ocp_show_inputs(const struct ocp_selector *tbl, u32 val, char *buf,
int def_val)
{ … }
static int
sma_parse_inputs(const struct ocp_selector * const tbl[], const char *buf,
enum ptp_ocp_sma_mode *mode)
{ … }
static ssize_t
ptp_ocp_sma_show(struct ptp_ocp *bp, int sma_nr, char *buf,
int default_in_val, int default_out_val)
{ … }
static ssize_t
sma1_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
sma2_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
sma3_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
sma4_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static int
ptp_ocp_sma_store_val(struct ptp_ocp *bp, int val, enum ptp_ocp_sma_mode mode, int sma_nr)
{ … }
static int
ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr)
{ … }
static ssize_t
sma1_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
sma2_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
sma3_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
sma4_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(sma1);
static DEVICE_ATTR_RW(sma2);
static DEVICE_ATTR_RW(sma3);
static DEVICE_ATTR_RW(sma4);
static ssize_t
available_sma_inputs_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(available_sma_inputs);
static ssize_t
available_sma_outputs_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(available_sma_outputs);
#define EXT_ATTR_RO(_group, _name, _val) …
#define EXT_ATTR_RW(_group, _name, _val) …
#define to_ext_attr(x) …
static ssize_t
signal_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
signal_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RW(signal, signal, 0);
static EXT_ATTR_RW(signal, signal, 1);
static EXT_ATTR_RW(signal, signal, 2);
static EXT_ATTR_RW(signal, signal, 3);
static ssize_t
duty_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(signal, duty, 0);
static EXT_ATTR_RO(signal, duty, 1);
static EXT_ATTR_RO(signal, duty, 2);
static EXT_ATTR_RO(signal, duty, 3);
static ssize_t
period_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(signal, period, 0);
static EXT_ATTR_RO(signal, period, 1);
static EXT_ATTR_RO(signal, period, 2);
static EXT_ATTR_RO(signal, period, 3);
static ssize_t
phase_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(signal, phase, 0);
static EXT_ATTR_RO(signal, phase, 1);
static EXT_ATTR_RO(signal, phase, 2);
static EXT_ATTR_RO(signal, phase, 3);
static ssize_t
polarity_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static EXT_ATTR_RO(signal, polarity, 0);
static EXT_ATTR_RO(signal, polarity, 1);
static EXT_ATTR_RO(signal, polarity, 2);
static EXT_ATTR_RO(signal, polarity, 3);
static ssize_t
running_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(signal, running, 0);
static EXT_ATTR_RO(signal, running, 1);
static EXT_ATTR_RO(signal, running, 2);
static EXT_ATTR_RO(signal, running, 3);
static ssize_t
start_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(signal, start, 0);
static EXT_ATTR_RO(signal, start, 1);
static EXT_ATTR_RO(signal, start, 2);
static EXT_ATTR_RO(signal, start, 3);
static ssize_t
seconds_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t
seconds_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RW(freq, seconds, 0);
static EXT_ATTR_RW(freq, seconds, 1);
static EXT_ATTR_RW(freq, seconds, 2);
static EXT_ATTR_RW(freq, seconds, 3);
static ssize_t
frequency_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static EXT_ATTR_RO(freq, frequency, 0);
static EXT_ATTR_RO(freq, frequency, 1);
static EXT_ATTR_RO(freq, frequency, 2);
static EXT_ATTR_RO(freq, frequency, 3);
static ssize_t
serialnum_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(serialnum);
static ssize_t
gnss_sync_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(gnss_sync);
static ssize_t
utc_tai_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t
utc_tai_offset_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(utc_tai_offset);
static ssize_t
ts_window_adjust_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t
ts_window_adjust_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(ts_window_adjust);
static ssize_t
irig_b_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
irig_b_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(irig_b_mode);
static ssize_t
clock_source_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
clock_source_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(clock_source);
static ssize_t
available_clock_sources_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(available_clock_sources);
static ssize_t
clock_status_drift_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(clock_status_drift);
static ssize_t
clock_status_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(clock_status_offset);
static ssize_t
tod_correction_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t
tod_correction_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(tod_correction);
#define _DEVICE_SIGNAL_GROUP_ATTRS(_nr) …
#define DEVICE_SIGNAL_GROUP(_name, _nr) …
DEVICE_SIGNAL_GROUP(…);
DEVICE_SIGNAL_GROUP(…);
DEVICE_SIGNAL_GROUP(…);
DEVICE_SIGNAL_GROUP(…);
#define _DEVICE_FREQ_GROUP_ATTRS(_nr) …
#define DEVICE_FREQ_GROUP(_name, _nr) …
DEVICE_FREQ_GROUP(…);
DEVICE_FREQ_GROUP(…);
DEVICE_FREQ_GROUP(…);
DEVICE_FREQ_GROUP(…);
static ssize_t
disciplining_config_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{ … }
static ssize_t
disciplining_config_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{ … }
static BIN_ATTR_RW(disciplining_config, OCP_ART_CONFIG_SIZE);
static ssize_t
temperature_table_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{ … }
static ssize_t
temperature_table_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{ … }
static BIN_ATTR_RW(temperature_table, OCP_ART_TEMP_TABLE_SIZE);
static struct attribute *fb_timecard_attrs[] = …;
static const struct attribute_group fb_timecard_group = …;
static const struct ocp_attr_group fb_timecard_groups[] = …;
static struct attribute *art_timecard_attrs[] = …;
static struct bin_attribute *bin_art_timecard_attrs[] = …;
static const struct attribute_group art_timecard_group = …;
static const struct ocp_attr_group art_timecard_groups[] = …;
static struct attribute *adva_timecard_attrs[] = …;
static const struct attribute_group adva_timecard_group = …;
static const struct ocp_attr_group adva_timecard_groups[] = …;
static void
gpio_input_map(char *buf, struct ptp_ocp *bp, u16 map[][2], u16 bit,
const char *def)
{ … }
static void
gpio_output_map(char *buf, struct ptp_ocp *bp, u16 map[][2], u16 bit)
{ … }
static void
_signal_summary_show(struct seq_file *s, struct ptp_ocp *bp, int nr)
{ … }
static void
_frequency_summary_show(struct seq_file *s, int nr,
struct frequency_reg __iomem *reg)
{ … }
static int
ptp_ocp_summary_show(struct seq_file *s, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int
ptp_ocp_tod_status_show(struct seq_file *s, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static struct dentry *ptp_ocp_debugfs_root;
static void
ptp_ocp_debugfs_add_device(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_debugfs_remove_device(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_debugfs_init(void)
{ … }
static void
ptp_ocp_debugfs_fini(void)
{ … }
static void
ptp_ocp_dev_release(struct device *dev)
{ … }
static int
ptp_ocp_device_init(struct ptp_ocp *bp, struct pci_dev *pdev)
{ … }
static void
ptp_ocp_symlink(struct ptp_ocp *bp, struct device *child, const char *link)
{ … }
static void
ptp_ocp_link_child(struct ptp_ocp *bp, const char *name, const char *link)
{ … }
static int
ptp_ocp_complete(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_phc_info(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_serial_info(struct device *dev, const char *name, int port, int baud)
{ … }
static void
ptp_ocp_info(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_detach_sysfs(struct ptp_ocp *bp)
{ … }
static void
ptp_ocp_detach(struct ptp_ocp *bp)
{ … }
static int
ptp_ocp_dpll_lock_status_get(const struct dpll_device *dpll, void *priv,
enum dpll_lock_status *status,
enum dpll_lock_status_error *status_error,
struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_state_get(const struct dpll_pin *pin, void *pin_priv,
const struct dpll_device *dpll, void *priv,
enum dpll_pin_state *state,
struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_mode_get(const struct dpll_device *dpll, void *priv,
enum dpll_mode *mode, struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_direction_get(const struct dpll_pin *pin,
void *pin_priv,
const struct dpll_device *dpll,
void *priv,
enum dpll_pin_direction *direction,
struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_direction_set(const struct dpll_pin *pin,
void *pin_priv,
const struct dpll_device *dpll,
void *dpll_priv,
enum dpll_pin_direction direction,
struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_frequency_set(const struct dpll_pin *pin,
void *pin_priv,
const struct dpll_device *dpll,
void *dpll_priv, u64 frequency,
struct netlink_ext_ack *extack)
{ … }
static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
void *pin_priv,
const struct dpll_device *dpll,
void *dpll_priv, u64 *frequency,
struct netlink_ext_ack *extack)
{ … }
static const struct dpll_device_ops dpll_ops = …;
static const struct dpll_pin_ops dpll_pins_ops = …;
static void
ptp_ocp_sync_work(struct work_struct *work)
{ … }
static int
ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static void
ptp_ocp_remove(struct pci_dev *pdev)
{ … }
static struct pci_driver ptp_ocp_driver = …;
static int
ptp_ocp_i2c_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static struct notifier_block ptp_ocp_i2c_notifier = …;
static int __init
ptp_ocp_init(void)
{ … }
static void __exit
ptp_ocp_fini(void)
{ … }
module_init(…) …;
module_exit(ptp_ocp_fini);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;