linux/drivers/platform/x86/intel/oaktrail.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Intel OakTrail Platform support
 *
 * Copyright (C) 2010-2011 Intel Corporation
 * Author: Yin Kangkai ([email protected])
 *
 * based on Compal driver, Copyright (C) 2008 Cezary Jackiewicz
 * <cezary.jackiewicz (at) gmail.com>, based on MSI driver
 * Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
 *
 * This driver does below things:
 * 1. registers itself in the Linux backlight control in
 *    /sys/class/backlight/intel_oaktrail/
 *
 * 2. registers in the rfkill subsystem here: /sys/class/rfkill/rfkillX/
 *    for these components: wifi, bluetooth, wwan (3g), gps
 *
 * This driver might work on other products based on Oaktrail. If you
 * want to try it you can pass force=1 as argument to the module which
 * will force it to load even when the DMI data doesn't identify the
 * product as compatible.
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/backlight.h>
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/fb.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/rfkill.h>

#include <acpi/video.h>

#define DRIVER_NAME
#define DRIVER_VERSION

/*
 * This is the devices status address in EC space, and the control bits
 * definition:
 *
 * (1 << 0):	Camera enable/disable, RW.
 * (1 << 1):	Bluetooth enable/disable, RW.
 * (1 << 2):	GPS enable/disable, RW.
 * (1 << 3):	WiFi enable/disable, RW.
 * (1 << 4):	WWAN (3G) enable/disable, RW.
 * (1 << 5):	Touchscreen enable/disable, Read Only.
 */
#define OT_EC_DEVICE_STATE_ADDRESS

#define OT_EC_CAMERA_MASK
#define OT_EC_BT_MASK
#define OT_EC_GPS_MASK
#define OT_EC_WIFI_MASK
#define OT_EC_WWAN_MASK
#define OT_EC_TS_MASK

/*
 * This is the address in EC space and commands used to control LCD backlight:
 *
 * Two steps needed to change the LCD backlight:
 *   1. write the backlight percentage into OT_EC_BL_BRIGHTNESS_ADDRESS;
 *   2. write OT_EC_BL_CONTROL_ON_DATA into OT_EC_BL_CONTROL_ADDRESS.
 *
 * To read the LCD back light, just read out the value from
 * OT_EC_BL_BRIGHTNESS_ADDRESS.
 *
 * LCD backlight brightness range: 0 - 100 (OT_EC_BL_BRIGHTNESS_MAX)
 */
#define OT_EC_BL_BRIGHTNESS_ADDRESS
#define OT_EC_BL_BRIGHTNESS_MAX
#define OT_EC_BL_CONTROL_ADDRESS
#define OT_EC_BL_CONTROL_ON_DATA


static bool force;
module_param(force, bool, 0);
MODULE_PARM_DESC();

static struct platform_device *oaktrail_device;
static struct backlight_device *oaktrail_bl_device;
static struct rfkill *bt_rfkill;
static struct rfkill *gps_rfkill;
static struct rfkill *wifi_rfkill;
static struct rfkill *wwan_rfkill;


/* rfkill */
static int oaktrail_rfkill_set(void *data, bool blocked)
{}

static const struct rfkill_ops oaktrail_rfkill_ops =;

static struct rfkill *oaktrail_rfkill_new(char *name, enum rfkill_type type,
					  unsigned long mask)
{}

static inline void __oaktrail_rfkill_cleanup(struct rfkill *rf)
{}

static void oaktrail_rfkill_cleanup(void)
{}

static int oaktrail_rfkill_init(void)
{}


/* backlight */
static int get_backlight_brightness(struct backlight_device *b)
{}

static int set_backlight_brightness(struct backlight_device *b)
{}

static const struct backlight_ops oaktrail_bl_ops =;

static int oaktrail_backlight_init(void)
{}

static void oaktrail_backlight_exit(void)
{}

static int oaktrail_probe(struct platform_device *pdev)
{}

static struct platform_driver oaktrail_driver =;

static int dmi_check_cb(const struct dmi_system_id *id)
{}

static const struct dmi_system_id oaktrail_dmi_table[] __initconst =;
MODULE_DEVICE_TABLE(dmi, oaktrail_dmi_table);

static int __init oaktrail_init(void)
{}

static void __exit oaktrail_cleanup(void)
{}

module_init();
module_exit(oaktrail_cleanup);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();