/*-1* Copyright (c) 2012 Damjan Marion <[email protected]>2* Copyright (c) 2015 Maksym Sobolyev <[email protected]>3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND15* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE18* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24* SUCH DAMAGE.25*/2627#ifndef __TPS65217X_H__28#define __TPS65217X_H__2930/*31* TPS65217 PMIC is a companion chip for AM335x SoC sitting on I2C bus32*/3334/* TPS65217 Registers */35#define TPS65217_CHIPID_REG 0x0036struct tps65217_chipid_reg {37unsigned int rev:4;38unsigned int chip:4;39#define TPS65217A 0x740#define TPS65217B 0xF41#define TPS65217C 0xE42#define TPS65217D 0x643} __attribute__((__packed__));4445#define TPS65217_INT_REG 0x0246struct tps65217_int_reg {47unsigned int usbi:1;48unsigned int aci:1;49unsigned int pbi:1;50unsigned int reserved3:1;51unsigned int usbm:1;52unsigned int acm:1;53unsigned int pbm:1;54unsigned int reserved7:1;55} __attribute__((__packed__));5657#define TPS65217_STATUS_REG 0x0A58struct tps65217_status_reg {59unsigned int pb:1;60unsigned int reserved1:1;61unsigned int usbpwr:1;62unsigned int acpwr:1;63unsigned int reserved4:3;64unsigned int off:1;65} __attribute__((__packed__));6667#define TPS65217_CHGCONFIG0_REG 0x0368struct tps65217_chgconfig0_reg {69unsigned int battemp:1;70unsigned int pchgtout:1;71unsigned int chgtout:1;72unsigned int active:1;73unsigned int termi:1;74unsigned int tsusp:1;75unsigned int dppm:1;76unsigned int treg:1;77} __attribute__((__packed__));7879#define TPS65217_CHGCONFIG1_REG 0x0480struct tps65217_chgconfig1_reg {81unsigned int chg_en:1;82unsigned int susp:1;83unsigned int term:1;84unsigned int reset:1;85unsigned int ntc_type:1;86unsigned int tmr_en:1;87unsigned int timer:2;88} __attribute__((__packed__));8990#define TPS65217_CHGCONFIG2_REG 0x0591struct tps65217_chgconfig2_reg {92unsigned int reserved:4;93unsigned int voreg:2;94#define TPS65217_VO_410V 0b0095#define TPS65217_VO_415V 0b0196#define TPS65217_VO_420V 0b1097#define TPS65217_VO_425V 0b1198unsigned int vprechg:1;99unsigned int dyntmr:1;100} __attribute__((__packed__));101102#define TPS65217_CHGCONFIG3_REG 0x06103struct tps65217_chgconfig3_reg {104unsigned int trange:1;105unsigned int termif:2;106unsigned int pchrgt:1;107unsigned int dppmth:2;108unsigned int ichrg:2;109} __attribute__((__packed__));110111#endif /* __TPS65217X_H__ */112113114