danieljeongadi / lkd Goto Github PK
View Code? Open in Web Editor NEWLinux Kernel Driver
Linux Kernel Driver
Hey,
I am working on MAX77958 in the linux environment, my FW_REV register returns 0xff
. Is max77958 array in the max7758-pass2.h
the firmware array.
I have added the max77958 and max 77960 driver in the build as I am using these chips in the below configuration.
I get the following logs
[ 6.239053] This line does get to run
[ 6.242807] of_max77958_dt: irq-gpio: 373
[ 6.248352] cur_irq=70
[ 6.249280] cur_irq=71
[ 6.252562] cur_irq=72
[ 6.255841] cur_irq=73
[ 6.259117] cur_irq=74
[ 6.262386] cur_irq=75
[ 6.265668] cur_irq=76
[ 6.268948] cur_irq=77
[ 6.272226] cur_irq=78
[ 6.275499] cur_irq=79
[ 6.278774] cur_irq=80
[ 6.282043] cur_irq=81
[ 6.285317] cur_irq=82
[ 6.288596] cur_irq=83
[ 6.291876] cur_irq=84
[ 6.295145] cur_irq=85
[ 6.298413] cur_irq=86
[ 6.301685] cur_irq=87
[ 6.304966] cur_irq=88
[ 6.308246] cur_irq=89
[ 6.311518] cur_irq=90
[ 6.314785] cur_irq=91
[ 6.318055] cur_irq=92
[ 6.321338] cur_irq=93
[ 6.324617] cur_irq=94
[ 6.328310] max77960_charger_probe: MAX77960 Charger Driver Loading
[ 6.336973] max77960 INTGPIO 373 assigned
[ 6.340975] max77960 property:INTGPIO 373
[ 6.344978] max77960 property:IRQ 95
[ 6.354197] max77960 set charge current: reg_data(0x47), charge(450)
[ 6.360548] max77960 set charge current: 450mA
[ 6.364980] max77960 not match the register.
[ 6.369242] max77960 set input current: reg_data(0x0b), current(500mA)
[ 6.375991] max77960 set input current: 500mA
[ 6.380345] max77960 not match the register.
[ 6.384605] max77960 set topoff cur: reg_data(0x18), topoff current(0)
[ 6.392157] Unable to handle kernel paging request at virtual address 0000393630302d30
[ 6.400075] Mem abort info:
[ 6.402856] ESR = 0x96000004
[ 6.405898] EC = 0x25: DABT (current EL), IL = 32 bits
[ 6.411198] SET = 0, FnV = 0
[ 6.414239] EA = 0, S1PTW = 0
Kernel panics and the firmware update also fails..
My kernel version is 5.15.36
Can you please guide me through this.
Thanks
~Umar
Problem
I believe MAX31343_MONTH_REG_MONTH
and MAX31343_HOURS_REG_HOURS
are incorrectly defined as 0x0F
When setting the date on the MAX31343 I found that months greater than September (9) would return to the system as January (1).
Suspected Cause
After investigating the driver I narrowed it down to:
https://github.com/Maxim-Integrated/LKD/blob/085f928cfb3f06bf0530d3bbb563258ea25df8f6/MAX31343/rtc-max31343.c#L601
The bitwise &
before the call to bcd2bin()
clears the higher digit.
For instance, when the month is set to November, Linux stores it as 0x0A
, and the MAX31343 stores it as 0x11
. (0x11 & 0x0F) - 1
evaluates to 0x00
, which Linux interprets as January.
Lines of interest
https://github.com/Maxim-Integrated/LKD/blob/085f928cfb3f06bf0530d3bbb563258ea25df8f6/MAX31343/rtc-max31343.c#L70
Proposed solution
MAX31343_MONTH_REG_MONTH
and MAX31343_HOURS_REG_HOURS
should be re-defined from 0x0F
to 0x1F
Many thanks that new MAX11410. But i do not understand the interrupt pin configuration in its device-tree source.
max11410-gpio1 = <6>;
Normaly, it should contains an interrupt parent config also, for a gpio controller node pointer, like this example drivers. ad7192, sc16is7xx
interrupt-parent = <&gpio3>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
It seems to me, probably this configuration is only working for Raspberry Pi 4, is it right? Can you improve it to be able to use in any kind of SoC as it is implemented in the example links?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.