Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add overlay for MCP3422/3/4 ADCs #2819

Closed
soosp opened this issue Jan 19, 2019 · 3 comments
Closed

Please add overlay for MCP3422/3/4 ADCs #2819

soosp opened this issue Jan 19, 2019 · 3 comments

Comments

@soosp
Copy link

soosp commented Jan 19, 2019

Describe the bug
There is no overlay for these chips but they are supported by linux kernel.
The command
echo mcp3422 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
loads the proper kernel module (mcp3422)

To reproduce
ls /boot/overlays/mcp34*
ls: cannot access '/boot/overlays/mcp34*': No such file or directory

Expected behaviour
Overlay available.

Actual behaviour
Overlay is missing.

System

  • Which model of Raspberry Pi?
    Raspberry Pi 3 model B

  • Which OS and version (cat /etc/rpi-issue)?
    Raspberry Pi reference 2018-11-13
    Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 7e0c786c641ba15990b5662f092c106beed40c9f, stage2

  • Which firmware version (vcgencmd version)?
    Nov 4 2018 16:31:07
    Copyright (c) 2012 Broadcom
    version ed5baf9520a3c4ca82ba38594b898f0c0446da66 (clean) (release)

  • Which kernel version (uname -a)?
    Linux pi3 4.14.79-v7+ USB-Harddrive gets fully powered down #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

Logs
If applicable, add the relevant output from dmesg or similar.

Additional context
Add any other relevant context for the problem.

@pelwell
Copy link
Contributor

pelwell commented Jan 21, 2019

There's a trial mcp342x overlay here. The README will say:

Name:   mcp342x
Info:   Overlay for activation of Microchip MCP3421-3428 ADCs over I2C
Load:   dtoverlay=mcp342x,<param>=<val>
Params: addr                    I2C bus address of device, for devices with
                                addresses that are configurable, e.g. by
                                hardware links (default=0x68)
        mcp3421                 The device is an MCP3421
        mcp3422                 The device is an MCP3422
        mcp3423                 The device is an MCP3423
        mcp3424                 The device is an MCP3424
        mcp3425                 The device is an MCP3425
        mcp3426                 The device is an MCP3426
        mcp3427                 The device is an MCP3427
        mcp3428                 The device is an MCP3428

@soosp
Copy link
Author

soosp commented Jan 21, 2019

Thanks for the quick response! It works well.

Here is my config:

/boot/config.txt:
# Enable MCP3422 ADC
dtoverlay=mcp342x,addr=0x68,mcp3422

The results:

lsmod | grep mcp342*
mcp3422                16384  0
industrialio           73728  1 mcp3422
ls -1 /sys/class/i2c-adapter/i2c-1/1-0068/iio\:device0/
dev
in_voltage0_raw
in_voltage0_scale
in_voltage1_raw
in_voltage1_scale
in_voltage_sampling_frequency
in_voltage_scale_available
name
of_node
power
sampling_frequency_available
subsystem
uevent
cat /sys/class/i2c-adapter/i2c-1/1-0068/iio\:device0/in_voltage0_raw
287

pelwell pushed a commit that referenced this issue Jan 22, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Jan 22, 2019

Thanks - that's now merged, and will be in future releases.

popcornmix added a commit to raspberrypi/firmware that referenced this issue Jan 22, 2019
kernel: overlays: Add ssd1306 overlay for OLED display
See: #1098

kernel: overlays: mcp23017: Support the MCP23008
See: raspberrypi/linux#2818

kernel: overlays: Add mcp342x overlay
See: raspberrypi/linux#2819

kernel: configs: Add CONFIG_USB_UAS=m
See: raspberrypi/linux#2813

firmware: interface: Drop vcfiled
See: raspberrypi/userland#525

firmware: Add reference counting to the local audio players
See: #547

firmware: arm_loader: Add reporting the firmware git hash via the mailbox
firmware: vcos: Add reporting of which variant was built
See: raspberrypi/linux#2806

firmware: Update vcdbg help
See: #594
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Jan 22, 2019
kernel: overlays: Add ssd1306 overlay for OLED display
See: raspberrypi/firmware#1098

kernel: overlays: mcp23017: Support the MCP23008
See: raspberrypi/linux#2818

kernel: overlays: Add mcp342x overlay
See: raspberrypi/linux#2819

kernel: configs: Add CONFIG_USB_UAS=m
See: raspberrypi/linux#2813

firmware: interface: Drop vcfiled
See: raspberrypi/userland#525

firmware: Add reference counting to the local audio players
See: raspberrypi/firmware#547

firmware: arm_loader: Add reporting the firmware git hash via the mailbox
firmware: vcos: Add reporting of which variant was built
See: raspberrypi/linux#2806

firmware: Update vcdbg help
See: raspberrypi/firmware#594
pelwell pushed a commit that referenced this issue Jan 23, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Jan 23, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Jan 23, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 24, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
ahmedradaideh pushed a commit to ahmedradaideh/Pi-Kernel that referenced this issue Jan 29, 2019
Support the MCP342x family of ADCs from Microchip.

See: raspberrypi/linux#2819

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: ahmedradaideh <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 4, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 4, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 4, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 22, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 24, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Feb 26, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 6, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 6, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 6, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 12, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 15, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 15, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 15, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 21, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Mar 21, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 2, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 2, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 2, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
artynet pushed a commit to artynet/rpi-linux that referenced this issue Apr 3, 2019
Support the MCP342x family of ADCs from Microchip.

See: raspberrypi#2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 8, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 8, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
Gadgetoid pushed a commit to Gadgetoid/linux that referenced this issue Apr 10, 2019
Support the MCP342x family of ADCs from Microchip.

See: raspberrypi#2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 23, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 30, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Apr 30, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue May 7, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell closed this as completed May 8, 2019
popcornmix pushed a commit that referenced this issue May 13, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
TiejunChina pushed a commit that referenced this issue Jun 19, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
TiejunChina pushed a commit that referenced this issue Jul 23, 2019
Support the MCP342x family of ADCs from Microchip.

See: #2819

Signed-off-by: Phil Elwell <[email protected]>
anirbanray1981-zz pushed a commit to anirbanray1981-zz/ubuntu-disco that referenced this issue Sep 18, 2019
Support the MCP342x family of ADCs from Microchip.

See: raspberrypi/linux#2819

Signed-off-by: Phil Elwell <[email protected]>
shyam334 pushed a commit to shyam334/disco that referenced this issue Oct 1, 2019
Support the MCP342x family of ADCs from Microchip.

See: raspberrypi/linux#2819

Signed-off-by: Phil Elwell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants