misc: Import wl2866d from mondrian-s-oss

Also ran clang-format

Change-Id: Id27e570d4847339c1224b6b175136c7292e748cc
This commit is contained in:
Arian 2023-12-09 14:22:09 +01:00 committed by Jens Reidel
parent 938968a9b3
commit 6a749ee3d5
No known key found for this signature in database
GPG Key ID: 23C1E5F512C12303
4 changed files with 1137 additions and 0 deletions

View File

@ -509,6 +509,12 @@ config KINECTICS_XR_NORDIC
this also parses the gpios and interrupts from device tree and sets
the gpios and interrupt handler for handling the interrupt.
config LDO_WL2866D
tristate "WL2866 regulators"
help
This driver provides support for the voltage regulators and top-level
chip enablement of WL2866
source "drivers/misc/rtimd-i2c/Kconfig"
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"

View File

@ -69,3 +69,4 @@ qseecom-mod-$(CONFIG_COMPAT) += compat_qseecom.o
obj-$(CONFIG_WIGIG_SENSING_SPI) += wigig_sensing.o
obj-$(CONFIG_KINECTICS_XR_NORDIC) += kxrctrl/
obj-y += hwid/
obj-$(CONFIG_LDO_WL2866D) += wl2866d.o

1061
drivers/misc/wl2866d.c Normal file

File diff suppressed because it is too large Load Diff

69
include/misc/wl2866d.h Normal file
View File

@ -0,0 +1,69 @@
/*
* Marvell 88PM80x Interface
*
* Copyright (C) 2012 Marvell International Ltd.
* Qiao Zhou <zhouqiao@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __WL2866D_H
#define __WL2866D_H
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/atomic.h>
#include <linux/regulator/consumer.h>
#define WL2866D_DEBUG 1
#define VIN1_1P35_VOL_MIN 1350000
#define VIN1_1P35_VOL_MAX 1350000
#define VIN2_3P3_VOL_MIN 3296000
#define VIN2_3P3_VOL_MAX 3296000
int wl2866d_camera_power_up(int out_iotype, int out_delay);
int wl2866d_camera_power_down(int out_iotype, int out_delay);
int wl2866d_camera_power_up_eeprom(void);
int wl2866d_camera_power_down_eeprom(void);
int wl2866d_camera_power_down_all(void);
int wl2866d_camera_power_up_all(void);
struct wl2866d_chip {
struct device *dev;
struct i2c_client *client;
int en_gpio;
struct regulator *vin1;
struct regulator *vin2;
};
struct wl2866d_map {
u8 reg;
u8 value;
};
struct wl2866d_voltage {
u8 avdd1;
u8 avdd2;
u8 dvdd1;
u8 dvdd2;
};
enum {
OUT_DVDD1,
OUT_DVDD2,
OUT_AVDD1,
OUT_AVDD2,
VOL_ENABLE,
VOL_DISABLE,
DISCHARGE_ENABLE,
DISCHARGE_DISABLE,
};
#define POWER_UP_ALL_INDEX VOL_ENABLE
#define LAST_POWER_CH OUT_AVDD2
#endif /* __WL2866D_H */