wants to use other AIN pin

Peter
Hello People,

I've been using 2440 board since a long time, A friend of mine wants to use
ADC of the baord for his college project. He wants to use 4 Analog input of
this board. I've explore the diagram and found there are sufficient Analog
input on the board but I can use only one ADC pin that is AIN0 out of 4.
What should i do If I wants to use all AIN pin? 

Your Help will be very helpful for me to move ahead with this project.

Thank you for your time and consideration.

Look forward to hear from you soon.

Regards,
Peter

Screwface
Hello,

Which BSP do you use? If you are using FriendlyARM BSP, the driver is
written for AIN0 only. If you want to use other ADC channels, you have to
modify the driver or write your own one.
If you use Juergen BSP (Pengutronix one), they are all already available by
default.

Regards,
Screwface

Peter
@Screwface,

Thanks for the prompt reply, Yes I am using Friendly ARM BSP, I've compiled
Juergen BSP for giving linux 3.1 a try, but will try 3.1 again. BTW, that
BSP has all are available by default, but how can i use all other? do i
need to write the driver for the same as like Friendly ARM BSP provide for
default AIN0? or one driver will be sufficient for the all?

can you please let me know?

Thank you for your time.

Regards,
Peter

Juergen Beisert
a) connect your sources to pin 5,6,7 or 8 at CON4 (check voltage levels!)
b) read from the hwmon sysfs entries the converted values (open(), read(),
close())
That's it.

Peter
@Juergen,

Linux 3.1 is up and running, but I am unable to find the /sys/ interface
for the same, can you please tell the exact sysfs entries to watch?

ls /sys/devices/platform/s3c24xx-adc/s3c-hwmon
modalias   power      subsystem  uevent


these are the entries, which entries to watch If I am in right direction Or
tell me the correct path to look up the value for all other ADC pin.

Thank you for your time.

--
Peter

Juergen Beisert
Mine is looking a little bit different:

root@mini2440:/sys/devices/platform/s3c24xx-adc/s3c-hwmon ls
adc0_raw   adc4_raw   driver     in1_input  in3_input  in5_input
in7_input  subsystem  adc1_raw   adc5_raw   hwmon      in1_label
in3_label  in5_label  in7_label  uevent     adc2_raw   adc6_raw
in0_input  in2_input  in4_input  in6_input  modalias   adc3_raw
adc7_raw   in0_label  in2_label  in4_label  in6_label  power

Peter
Hello Juergen,

Wow, its working perfectly good for your, but mine is not working as per
expectation. I am running Linux 3.1 compiled using Pegutronic, Please tell
me what to do to get it working ?

Do i need to attach a ADC Hardware or I will have this data once after
Linux boot.

Please guide me on this.


Regards,
Peter

Juergen Beisert
If you use my Mini2440 BSP, it should be enabled by default. You can check,
if in your kernel config the following defines are set:

CONFIG_S3C_ADC=y
CONFIG_S3C_DEV_HWMON=y
CONFIG_HWMON=y
CONFIG_SENSORS_S3C=y
CONFIG_SENSORS_S3C_RAW=y

Peter
Hello Juergen,

Thank you very much for your time, I've enabled hwmon and all value are now
appear under /sys.

Thanks a lot, Now I need to attach Hardware and need to monitor the value.


Regards,
Peter

nicky jack
Hi.......  @Juergen 

How can i check these........

CONFIG_S3C_ADC=y
CONFIG_S3C_DEV_HWMON=y
CONFIG_HWMON=y
CONFIG_SENSORS_S3C=y
CONFIG_SENSORS_S3C_RAW=y

regards
Jack

Juergen Beisert
These are variables used in the Kconfig buildsystem of the Linux kernel. If
you use a plain kernel run "make menuconfig" to enable these variables, if
you are using PTXdist, run "ptxdist kernelconfig" instead (both will bring
you to the same Kconfig menu).

Jan Tesar
Hello guys,

I've read that Peter had a success with adding hwmon feature to his
/sys/... 

I tried the same approach with building my kernel with Juergen settings but
not successfully.

I'am using FriendlyARM mini6410 so there is maybe difference between kernel
settings for 2440 and 6410.

Does somebody have an experience with ADC on 6410?

I'm getting crazy about this issue.. recompiling kernel all the time
without hoped result.

Thanks,

Jan

Juergen Beisert
To be able to use the ADC you need to:
 - enable the driver in the kernel
 - *and* register the ADC hardware at run-time

Only if both is done, you will get the entries in the sysfs.

Jan Tesar
I gave up this way of launching ADC and currently trying to use ptxdist.
 
So I will write down, how does it go. I hope that there are necessary
patches already applied, because I'm not able to do it by myself.

Thanks Juergen,
Jan

Jan Tesar
Well, I had a success with ptxdist, so now I'm able to access ADC, perfect!

Now I'm gonna learn how to add some other packages into filesystem, because
I'm missing here some things like boa, ssh, ftp.. but I hope this will not
be big issue.

Jan

Juergen Beisert
Just run "ptxdist menuconfig" and enable the other packages you expect to
be present in your Mini6410 filesystem. After a "ptxdsit go" they will be
present.

Ezequiel Netto
Hi Juergen Beisert,

What are you mean with " *and* register the ADC hardware at run-time"?