android - in Linux kernel module how can I read a file into this ? static const struct fw_data GSL1680_FW[] = {filecontent} -


i attempting modify existing linux kernel module load firmware data file on filesystem. have examined many ways of doing in other module code require major modification existing code. use .h file contain modifications , retain driver file modified driver can more portable.

the way driver written calls .h file obtain needed values, pre-set in .h file have .h file obtain data configuration file on disk (flash driver android) . have searched extensively comparable method of reading data file none store data in form needed module. here hold data :

struct fw_data { u32 offset : 8; u32 : 0; u32 val; };  static const struct fw_data gsl1680_fw[] = { {0xf0,0x3}, {0x00,0xa5a5ffc0}, {0x04,0x00000000}, {0x08,0xe810c4e1}, {0x0c,0xd3dd7f4d}, {0x10,0xd7c56634}, {0x14,0xe3505a2a}, {0x18,0x514d494f}, {0x1c,0xb83a7121}, {0x20,0x00000000}, {0x24,0x00000000}, {0x28,0x00000000}, {0x2c,0x00000000}, {0x30,0x00001000}, {0x34,0x00000000}, {0x38,0x00000000}, {0x3c,0x00000000}, {0x40,0x00000001}, {0x44,0x00000000}, {0x48,0x00000000}, {0x4c,0x00000000}, {0x50,0x00000000}, {0x54,0x01020304}, {0x58,0x05060708}, {0x5c,0x090a0b0c}, {0x60,0x0d0e0e0f}, {0x64,0x10111213}, {0x68,0x14151617}, {0x6c,0x18191a1b}, {0x70,0x1b1c1e1f}, {0x74,0x00000000}, {0x78,0x00010000}, {0x7c,0x8c846af3}, {0xf0,0x4}, {0x00,0x00000000}, {0x04,0x00000000}, {0x08,0x00000000}, {0x0c,0x00000000}, {0x10,0xffffff38}, {0x14,0x00000000}, {0x18,0x00000000}, {0x1c,0x00000000}, {0x20,0x00000000}, {0x24,0x00000000}, {0x28,0x00000000}, {0x2c,0x00000000}, {0x30,0x00002400}, {0x34,0x00000000}, {0x38,0x00000000}, {0x3c,0x00000000}, {0x40,0x00000000}, {0x44,0x00000002}, {0x48,0x00000001}, {0x4c,0x00004000}, {0x50,0x00000000}, {0x54,0x00010202}, {0x58,0x02030304}, {0x5c,0x05050606}, {0x60,0x07080909}, {0x64,0x0a0b0c0c}, {0x68,0x0d0e0f10}, {0x6c,0x11121416}, {0x70,0x16191c1e}, {0x74,0x00000000}, {0x78,0x80808080}, {0x7c,0x8c846af3}, {0xf0,0xb3}, {0x00,0x00001682}, {0x04,0x00000000}, {0x08,0x46656220}, {0x0c,0x20352032}, {0x10,0x30313300}, {0x14,0x00000000}, {0x18,0x31353a34}, {0x1c,0x383a3334}, {0x20,0x00000000}, {0x24,0x00000000}, {0x28,0x00000000}, {0x2c,0x00000000}, {0x30,0x00000000}, {0x34,0x00000000}, {0x38,0x00000000}, {0x3c,0x00000000}, {0x40,0x00000000}, {0x44,0x00000000}, {0x48,0x00000000}, {0x4c,0x00000000}, {0x50,0x00000000}, {0x54,0x00000000}, {0x58,0x00000000}, {0x5c,0x00000000}, {0x60,0x00000000}, {0x64,0x00000000}, {0x68,0x00000000}, {0x6c,0x00000000}, {0x70,0x00000000}, {0x74,0x00000000}, {0x78,0x00000000}, {0x7c,0x00000000}, }; 

i removed large section of included data same differing in addr, , data.. think above should give idea in there.

the values register location , hex data location.

there examples of modules have found load data directly chip file accomplishing similar functionality, have found make extensive changes main module in order accomplish this, , said retain main module close existing form possible functionality can implemented in differing versions of module , more portable 1 soc model next minimal modification main module between them.

i have tried read data gslx680[] using filp_read in several ways have not had success.

i far expert in c programming , have never attempted make of modification module before, , have never had deal reading data file in kernel space before. hobbyist attempting add functionality driver in order have solve many of issues differences in configuration on chinese made android devices using same soc. appreciated.

edit : added struct of fw_data above, had not known existed until reviewing code associated driver. sure @ point reason not data file gslx680[]. starting on now, suggestions appreciated.

thanks fsebentley


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -