Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2020 Jonathan Neuschäfer
0004  *
0005  * Register access and version information for the Netronix embedded
0006  * controller.
0007  */
0008 
0009 #ifndef NTXEC_H
0010 #define NTXEC_H
0011 
0012 #include <linux/types.h>
0013 
0014 struct device;
0015 struct regmap;
0016 
0017 struct ntxec {
0018     struct device *dev;
0019     struct regmap *regmap;
0020 };
0021 
0022 /*
0023  * Some registers, such as the battery status register (0x41), are in
0024  * big-endian, but others only have eight significant bits, which are in the
0025  * first byte transmitted over I2C (the MSB of the big-endian value).
0026  * This convenience function converts an 8-bit value to 16-bit for use in the
0027  * second kind of register.
0028  */
0029 static inline u16 ntxec_reg8(u8 value)
0030 {
0031     return value << 8;
0032 }
0033 
0034 /* Known firmware versions */
0035 #define NTXEC_VERSION_KOBO_AURA 0xd726  /* found in Kobo Aura */
0036 #define NTXEC_VERSION_TOLINO_SHINE2 0xf110 /* found in Tolino Shine 2 HD */
0037 
0038 #endif