#define pr_fmt(fmt) …
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/spi/spi.h>
#define DRV_VERSION …
#define DRV_DESC …
#define KS8995_REG_ID0 …
#define KS8995_REG_ID1 …
#define KS8995_REG_GC0 …
#define KS8995_REG_GC1 …
#define KS8995_REG_GC2 …
#define KS8995_REG_GC3 …
#define KS8995_REG_GC4 …
#define KS8995_REG_GC5 …
#define KS8995_REG_GC6 …
#define KS8995_REG_GC7 …
#define KS8995_REG_GC8 …
#define KS8995_REG_GC9 …
#define KS8995_REG_PC(p, r) …
#define KS8995_REG_PS(p, r) …
#define KS8995_REG_TPC0 …
#define KS8995_REG_TPC1 …
#define KS8995_REG_TPC2 …
#define KS8995_REG_TPC3 …
#define KS8995_REG_TPC4 …
#define KS8995_REG_TPC5 …
#define KS8995_REG_TPC6 …
#define KS8995_REG_TPC7 …
#define KS8995_REG_MAC0 …
#define KS8995_REG_MAC1 …
#define KS8995_REG_MAC2 …
#define KS8995_REG_MAC3 …
#define KS8995_REG_MAC4 …
#define KS8995_REG_MAC5 …
#define KS8995_REG_IAC0 …
#define KS8995_REG_IAC1 …
#define KS8995_REG_IAD7 …
#define KS8995_REG_IAD6 …
#define KS8995_REG_IAD5 …
#define KS8995_REG_IAD4 …
#define KS8995_REG_IAD3 …
#define KS8995_REG_IAD2 …
#define KS8995_REG_IAD1 …
#define KS8995_REG_IAD0 …
#define KSZ8864_REG_ID1 …
#define KS8995_REGS_SIZE …
#define KSZ8864_REGS_SIZE …
#define KSZ8795_REGS_SIZE …
#define ID1_CHIPID_M …
#define ID1_CHIPID_S …
#define ID1_REVISION_M …
#define ID1_REVISION_S …
#define ID1_START_SW …
#define FAMILY_KS8995 …
#define FAMILY_KSZ8795 …
#define CHIPID_M …
#define KS8995_CHIP_ID …
#define KSZ8864_CHIP_ID …
#define KSZ8795_CHIP_ID …
#define KS8995_CMD_WRITE …
#define KS8995_CMD_READ …
#define KS8995_RESET_DELAY …
enum ks8995_chip_variant { … };
struct ks8995_chip_params { … };
static const struct ks8995_chip_params ks8995_chip[] = …;
struct ks8995_switch { … };
static const struct spi_device_id ks8995_id[] = …;
MODULE_DEVICE_TABLE(spi, ks8995_id);
static const struct of_device_id ks8895_spi_of_match[] = …;
MODULE_DEVICE_TABLE(of, ks8895_spi_of_match);
static inline u8 get_chip_id(u8 val)
{ … }
static inline u8 get_chip_rev(u8 val)
{ … }
static inline __be16 create_spi_cmd(struct ks8995_switch *ks, int cmd,
unsigned address)
{ … }
static int ks8995_read(struct ks8995_switch *ks, char *buf,
unsigned offset, size_t count)
{ … }
static int ks8995_write(struct ks8995_switch *ks, char *buf,
unsigned offset, size_t count)
{ … }
static inline int ks8995_read_reg(struct ks8995_switch *ks, u8 addr, u8 *buf)
{ … }
static inline int ks8995_write_reg(struct ks8995_switch *ks, u8 addr, u8 val)
{ … }
static int ks8995_stop(struct ks8995_switch *ks)
{ … }
static int ks8995_start(struct ks8995_switch *ks)
{ … }
static int ks8995_reset(struct ks8995_switch *ks)
{ … }
static ssize_t ks8995_registers_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count)
{ … }
static ssize_t ks8995_registers_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count)
{ … }
static int ks8995_get_revision(struct ks8995_switch *ks)
{ … }
static const struct bin_attribute ks8995_registers_attr = …;
static int ks8995_probe(struct spi_device *spi)
{ … }
static void ks8995_remove(struct spi_device *spi)
{ … }
static struct spi_driver ks8995_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…);
MODULE_VERSION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;