Originally Posted by manveru0
I've changed the fsa9480.h file under /include/linux/i2c and compiled the OC Kernel with it. Everything went well so there are at least no functions in the header file which ain't listed in the fsa9480.c file under /drivers/misc/fsa9480.c
Here's the link to the full package with the new kernel, though I doubt this will work (see skywalkers statement about the header files):
WARNING: As this thread is in the I9000 forum I must warn you! This is a kernel/CWM package for the I9001 aka Galaxy S Plus. Do not flash this on a I9000 or you'll brick your phone!
The output concerning fsa9480.c during the compile process was:
drivers/misc/fsa9480.c: In function 'fsa9480_i2c_tx_data':
drivers/misc/fsa9480.c:344:2: warning: ISO C90 forbids mixed declarations and code
drivers/misc/fsa9480.c: In function 'fsa9480_i2c_rx_data':
drivers/misc/fsa9480.c:388:2: warning: ISO C90 forbids mixed declarations and code
drivers/misc/fsa9480.c: In function 'fsa9480_chip_init':
drivers/misc/fsa9480.c:460:2: warning: large integer implicitly truncated to unsigned type
drivers/misc/fsa9480.c:464:2: warning: large integer implicitly truncated to unsigned type
drivers/misc/fsa9480.c: In function 'usb_switch_show':
drivers/misc/fsa9480.c:612:2: warning: ISO C90 forbids mixed declarations and code
drivers/misc/fsa9480.c:619:2: warning: 'return' with no value, in function returning non-void
drivers/misc/fsa9480.c:626:3: warning: 'return' with no value, in function returning non-void
drivers/misc/fsa9480.c: In function 'usb_switch_store':
drivers/misc/fsa9480.c:657:2: warning: ISO C90 forbids mixed declarations and code
drivers/misc/fsa9480.c:687:1: warning: no return statement in function returning non-void
drivers/misc/fsa9480.c: In function 'disable_vbus_store':
drivers/misc/fsa9480.c:710:1: warning: no return statement in function returning non-void
drivers/misc/fsa9480.c: In function 'DefaultESNStatus_switch_store':
drivers/misc/fsa9480.c:886:1: warning: no return statement in function returning non-void
drivers/misc/fsa9480.c: At top level:
drivers/misc/fsa9480.c:1557:2: warning: initialization from incompatible pointer type
drivers/misc/fsa9480.c:264:1: warning: 'dev_attr_KiesStatus' defined but not used
drivers/misc/fsa9480.c:591:12: warning: 'get_current_mode' defined but not used
drivers/misc/fsa9480.c:888:1: warning: 'dev_attr_DefaultESNStatus' defined but not used
drivers/misc/fsa9480.c:921:1: warning: 'dev_attr_dock' defined but not used
drivers/misc/fsa9480.c: In function 'fsa9480_chip_init':
drivers/misc/fsa9480.c:461:5: warning: 'ret' may be used uninitialized in this function
in addition, there are links to what may be original sources (we need to check them if the kernel above won't work):
and a patch:
@manveru0: OK, so we were right that this won't work because it's just not enough. But it's the right direction and some additional changes still need to be made. The compiler warnings also seem to show that the used versions of fsa9480.c and fsa9480.h don't match. At least some of them.
I just had a look at the code in your given links above and analysed the code a little bit. Here are the results:
- the patch in the lkml link is already included in the latest version 3.2 of the lxr link
- BUT although this is a Samsung source code it is not meant for use with the Galaxy phones. It is just a generic linux kernel code and does NOT include the necessary "CAR_KIT" code.
- apart from an extremely different code architecture the fsa9480.c version that is provided in the I9001 sources DOES contain a lot of "CAR_KIT" references and is also much longer so this definitely seems to be the right code which we are looking for.
- the latter code can be found in kernel/drivers/misc and this is exactly the path where your compiler warnings derive from. So to my best knowledge and understanding you are already compiling the correct fsa9480.c code and there is "only" one step left: get rid of all the warnings so the code can work as intended.
- the ISO C90 warnings can generally be ignored as they just refer to programming style and standards which might be inappropriate for you anyway and definitely are for the author of the code ;)
Just one example from line 612, original code is:
mm_segment_t fs = get_fs();
Replacing that with two lines, first declaration, then program code like this should remove the warning as ISO C90 is fulfilled:
fs = get_fs();
Well, the latter version is kind of beginner's code for the slow-witted and every experienced hardcore-coder would just laugh at that but the same goes for the ISO C90 standard. Well, that's of course just my opinion. And that of a huge bunch of somewhat experienced coders I know
- you replaced fsa9480.h in include/linux/i2c which is included in kernel/drivers/misc/fsa9480.c. But looking at the code I found that it's a conditional include, the code actually says:
#if defined(CONFIG_MACH_ARIESVE) || defined(CONFIG_MACH_ANCORA) || defined(CONFIG_MACH_GODART)
So as CONFIG_MACH_ARIESVE is defined in your FeaCore_config only include/linux/fsa9480.h is actually included by fsa9480.c.
- now I compared include/linux/fsa9480.h and include/linux/i2c/fsa9480.h and except for two additional empty lines and Windows EOLs in /linux/i2c instead of Linux EOLs in /linux the files are completely identical. This leads only to one conclusion: include/linux/fsa9480.h in the I9001 sources is the wrong version but only this one should be exchanged.
You could give this another try and I think here are still some grateful testers for a second test version. I'm not sure if this is really the final solution and end of the story but I can have another look at the new warnings of the compiler output with the proposed modification - if there are still any left.