Closed Thread
Thread Tools
Posts: 1,104 | Thanked: 5,652 times | Joined on Feb 2010 @ Holland
#241
Originally Posted by Dave999 View Post
Donated. would be possible to get jolla involved in this?
If they would answer their email!

 

The Following 2 Users Say Thank You to dirkvl For This Useful Post:
kimmoli's Avatar
Posts: 562 | Thanked: 2,744 times | Joined on Dec 2013 @ Espoo, Finland
#242
maybe i need to get my own TCA8424 evkit too...
 
Posts: 1,104 | Thanked: 5,652 times | Joined on Feb 2010 @ Holland
#243
Originally Posted by kimmoli View Post
maybe i need to get my own TCA8424 evkit too...
http://nl.mouser.com/Search/Refine.aspx?Keyword=tca8424
 
Morpog's Avatar
Posts: 956 | Thanked: 2,628 times | Joined on Nov 2011
#244
dirkvl, it's better to get in contact with Jolla devs by IRC or mailinglist.

Several of them are around on freenode server on #jollamobile and #sailfishos
 

The Following User Says Thank You to Morpog For This Useful Post:
Posts: 4 | Thanked: 12 times | Joined on Dec 2013 @ Zagreb
#245
Today I don't have much time to analize, but i've found some interesting sources.
There are no userspace applications communicating over the i2c except for csd. Only the kernel modules.

Sources:
For cover switch (toh-event):
https://github.com/KonstaT/sailfisho...sc/toh-event.c
This module loads toh-core on cover key event.

For eeprom (toh-core):
https://github.com/KonstaT/sailfisho...vers/mfd/toh.c

If an eeprom with valid data is present, toh will appear in /sys fs.

From toh-core source eeprom data structure format can be extracted and than tested.


Looking at /boot/config*, it looks like support for TCA8418 is not enabled. (I didn't check if it is compatible with 8424).

Maybe an plugin like the /usr/lib/tohd/tohd-plugin-nfc-nxp.so has to be written.
 

The Following 6 Users Say Thank You to dcihlar For This Useful Post:
Posts: 1,104 | Thanked: 5,652 times | Joined on Feb 2010 @ Holland
#246
Originally Posted by dcihlar View Post
For eeprom (toh-core):
https://github.com/KonstaT/sailfisho...vers/mfd/toh.c

If an eeprom with valid data is present, toh will appear in /sys fs.

From toh-core source eeprom data structure format can be extracted and than tested.
The whole workings of the eeprom is very valuable in my eyes! If the eeprom could carry out commands, download files and install programs and deamons etc, all custom OH's can really be made plug&play.

This is a make or break condition for usage of the OH for the general public!
 

The Following 5 Users Say Thank You to dirkvl For This Useful Post:
Posts: 30 | Thanked: 42 times | Joined on Oct 2010 @ Russia
#247
Originally Posted by dirkvl View Post
The TCA8424 documentation says:
...
The example in the datasheet uses mixed R/W i2c transactions that are not available from userspace through i2c-dev interface. I still think that it should be possible to split a read transaction into two.

Here is a python code that may read values of the first registers, if it fails on the first write(), try changing address to 0x77.
Code:
#!/usr/bin/python

import fcntl
import os
import struct

class I2C(object):
    I2C_SLAVE = 0x0703

    def __init__(self, fname):
        self.fd = os.open(fname, os.O_RDWR)

    def __del__(self):
        os.close(self.fd)
    
    def select_device(self, devaddr):
        if fcntl.ioctl(self.fd, self.I2C_SLAVE, devaddr) < 0:
            return IOError('ioctl error')
    
    def write(self, data):
        os.write(self.fd, data)
   
    def read(self, count):
        data = ''
        while 1:
            d = os.read(self.fd, count - len(data))
            if len(d)==0:
                raise IOError("EOF while reading %d bytes" % count)

            data += d
            if len(data) == count:
                return data

if __name__ == '__main__':
    port = I2C('/dev/i2c-1')
    port.select_device(0x76) # or 0x77
    for i in range(10):
        port.write(struct.pack('<H', i))
        v = ord(p.read(1))
        print "reg=%02Xh val=%02Xh" % (i, v)
Copy it to a file and run "python filename.py" as root. My best guess is that it won't destroy your phone... I cannot test it on mine, since I have none, and won't have for a month at least. If the code works, I'll clean it up, and it should be easy to work with, as no compilation is required.

One more thing... It looks like this chip supports generic i2c HID interface and there is a module in mainline kernel for it. Try "modprobe i2c-hid" to see if the module is compiled and available... In any case it shouldn't work, as i2c lacks autoprobing and the proper way is to specify the device in the devicetree file...

Edit: Tried the code on n900 (and fixed it a bit), n900 is still alive )

Last edited by butler; 2014-01-04 at 22:06.
 
kimmoli's Avatar
Posts: 562 | Thanked: 2,744 times | Joined on Dec 2013 @ Espoo, Finland
#248
we had lots of progress today with dirkvl.

input and output reports are both working (leds blinking on evkit , and usage id's change when shorting matrix)
 

The Following 13 Users Say Thank You to kimmoli For This Useful Post:
Posts: 1,104 | Thanked: 5,652 times | Joined on Feb 2010 @ Holland
#249
looks 'a bit' hackish


filmed with my trusty old N9, software provided bij kimmoli!
 

The Following 10 Users Say Thank You to dirkvl For This Useful Post:
Posts: 4 | Thanked: 12 times | Joined on Dec 2013 @ Zagreb
#250
Originally Posted by dirkvl View Post
The whole workings of the eeprom is very valuable in my eyes! If the eeprom could carry out commands, download files and install programs and deamons etc, all custom OH's can really be made plug&play.

This is a make or break condition for usage of the OH for the general public!
Unfortunately, it's not what I meant to say.
toh (as in toh-core kernel module) appears somewhere in the /sys fs. And in it's directory eeprom configuration items.
 
Closed Thread

Tags
keyboard, limited-edition, otherhalf, qwerty


 
Forum Jump


All times are GMT. The time now is 12:45.