linux/drivers/leds/leds-cr0014114.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018 Crane Merchandising Systems. All rights reserved.
// Copyright (C) 2018 Oleh Kravchenko <[email protected]>

#include <linux/delay.h>
#include <linux/leds.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/workqueue.h>

/*
 *  CR0014114 SPI protocol descrtiption:
 *  +----+-----------------------------------+----+
 *  | CMD|             BRIGHTNESS            |CRC |
 *  +----+-----------------------------------+----+
 *  |    | LED0| LED1| LED2| LED3| LED4| LED5|    |
 *  |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
 *  |    |R|G|B|R|G|B|R|G|B|R|G|B|R|G|B|R|G|B|    |
 *  | 1  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1  |
 *  |    |1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|    |
 *  |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    |
 *  |    |               18                  |    |
 *  +----+-----------------------------------+----+
 *  |                    20                       |
 *  +---------------------------------------------+
 *
 *  PS: Boards can be connected to the chain:
 *      SPI -> board0 -> board1 -> board2 ..
 */

/* CR0014114 SPI commands */
#define CR_SET_BRIGHTNESS
#define CR_INIT_REENUMERATE
#define CR_NEXT_REENUMERATE

/* CR0014114 default settings */
#define CR_MAX_BRIGHTNESS
#define CR_FW_DELAY_MSEC
#define CR_RECOUNT_DELAY

#define CR_DEV_NAME

struct cr0014114_led {};

struct cr0014114 {};

static void cr0014114_calc_crc(u8 *buf, const size_t len)
{}

static int cr0014114_recount(struct cr0014114 *priv)
{}

static int cr0014114_sync(struct cr0014114 *priv)
{}

static void cr0014114_recount_work(struct work_struct *work)
{}

static int cr0014114_set_sync(struct led_classdev *ldev,
			      enum led_brightness brightness)
{}

static int cr0014114_probe_dt(struct cr0014114 *priv)
{}

static int cr0014114_probe(struct spi_device *spi)
{}

static void cr0014114_remove(struct spi_device *spi)
{}

static const struct of_device_id cr0014114_dt_ids[] =;

MODULE_DEVICE_TABLE(of, cr0014114_dt_ids);

static struct spi_driver cr0014114_driver =;

module_spi_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();