Code Monkey home page Code Monkey logo

cpcaprw's Introduction

READ AND WRITE CPCAP PMIC REGISTERS ON ANDROID DEVICES

This utility allows easily reading and writing the CPCAP PMIC registers
when booted to the Android kernel. The Motorola custom CPCAP PMIC is used
on various Motorola phones and tablets such as droid 4.

Note that it currently only supports the mainline kernel regmap suitable
registers offsets as listed in motorola-cpcap.h and not the Motorola
mapphone Linux kernel register index.

To build and use, just do:

$ export CROSS_COMPILE=/path/to/arm-linux-gnueabi
$ make
$ adb push cpcaprw /sdcard
$ adb shell
$ su
# mount -o rw,remount /system/bin
# cp/sdcard/cpcaprw /system/bin/
# cpcaprw 0x0048 # read CPCAP_REG_VERSC1
CPCAP register18 0x0048=0x0013

For write access, you probably need to modify the selinux permissions
for /dev/cpcap with chcon or something similar.

And note that to use the binary with most Android kernels, the compiler
must be armel and not armhf.

To see the cpcap registers with the mainline kernel, just do:

# cat /sys/kernel/debug/regmap/spi0.0/registers

cpcaprw's People

Contributors

tmlind avatar

Watchers

 avatar  avatar

Forkers

imbackk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.