linux/drivers/platform/x86/dell/dell-uart-backlight.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Dell AIO Serial Backlight Driver
 *
 * Copyright (C) 2024 Hans de Goede <[email protected]>
 * Copyright (C) 2017 AceLan Kao <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/serdev.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/wait.h>
#include <acpi/video.h>
#include "../serdev_helpers.h"

/* The backlight controller must respond within 1 second */
#define DELL_BL_TIMEOUT
#define DELL_BL_MAX_BRIGHTNESS

/* Defines for the commands send to the controller */

/* 1st byte Start Of Frame 3 MSB bits: cmd-len + 01010 SOF marker */
#define DELL_SOF(len)
#define GET_CMD_LEN
#define SET_CMD_LEN

/* 2nd byte command */
#define CMD_GET_VERSION
#define CMD_SET_BRIGHTNESS
#define CMD_GET_BRIGHTNESS
#define CMD_SET_BL_POWER

/* Indexes and other defines for response received from the controller */
#define RESP_LEN
#define RESP_CMD
#define RESP_DATA

#define SET_RESP_LEN
#define GET_RESP_LEN
#define MIN_RESP_LEN
#define MAX_RESP_LEN

struct dell_uart_backlight {};

/* Checksum: SUM(Length and Cmd and Data) xor 0xFF */
static u8 dell_uart_checksum(u8 *buf, int len)
{}

static int dell_uart_bl_command(struct dell_uart_backlight *dell_bl,
				const u8 *cmd, int cmd_len,
				u8 *resp, int resp_max_len)
{}

static int dell_uart_set_brightness(struct dell_uart_backlight *dell_bl, int brightness)
{}

static int dell_uart_get_brightness(struct dell_uart_backlight *dell_bl)
{}

static int dell_uart_set_bl_power(struct dell_uart_backlight *dell_bl, int power)
{}

/*
 * There is no command to get backlight power status,
 * so we set the backlight power to "on" while initializing,
 * and then track and report its status by power variable.
 */
static int dell_uart_get_bl_power(struct dell_uart_backlight *dell_bl)
{}

static int dell_uart_update_status(struct backlight_device *bd)
{}

static int dell_uart_get_brightness_op(struct backlight_device *bd)
{}

static const struct backlight_ops dell_uart_backlight_ops =;

static size_t dell_uart_bl_receive(struct serdev_device *serdev, const u8 *data, size_t len)
{}

static const struct serdev_device_ops dell_uart_bl_serdev_ops =;

static int dell_uart_bl_serdev_probe(struct serdev_device *serdev)
{}

struct serdev_device_driver dell_uart_bl_serdev_driver =;

static int dell_uart_bl_pdev_probe(struct platform_device *pdev)
{}

static void dell_uart_bl_pdev_remove(struct platform_device *pdev)
{}

static struct platform_driver dell_uart_bl_pdev_driver =;
module_platform_driver();

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