Re: Reading a config file in a driver ....
From: Misbah khan <hidden>
Date: 2008-01-04 08:32:24
i appriciate your concept and i need to know this :- The config should be in a structure or a bit mask . The user will have to change the value whenever he needs to change the default config. Where should i put that struct or bit field defination ???? He should know it preciesly before he change ???? Can you share with me your Implimentation so that i could get the exactly how you had done ... ----Misbah < >< Carlos Munoz-2 wrote:
Olof Johansson wrote:quoted
On Wed, Jan 02, 2008 at 09:03:20PM -0800, Misbah khan wrote:quoted
Hi all .... I am writing a LCD driver in which the default configuration for LCD would be loded at the Init . This default configuration if keep in the driver then for a change in default configuration we need to compile the driver which we never want . Hence we want a .config file in /etc/lcd.config dir which could be changed and the next boot will take this configuration as the default configuration. I need to know How to read from the config file in the driver form the dir /etc/lcd.config. The driver would be installed at boot upThe driver/kernel shouldn't read the file directly, if anything you should have a userspace tool that reads it and adjusts the driver via sysfs or similar. That tool can be run from some of the init scripts, or from the ramdisk in case you want to do it early.What I've done in the past is to use module_param() to define variables that get set when the module is loaded. Then all you need to do is edit the /etc/modules file and change the parameter value. However, this technique is only efficient if only a few parameters will ever change. If you need to change more than a few parameters, Olof's suggestion would be preferred. Carlos _______________________________________________ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
-- View this message in context: http://www.nabble.com/Reading-a-config-file-in-a-driver-....-tp14591717p14612548.html Sent from the linuxppc-embedded mailing list archive at Nabble.com.