All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Eckert <fe@dev.tdt.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Enrico Weigelt <info@metux.net>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jean Delvare <jdelvare@suse.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Eckert.Florian@googlemail.com, linux-gpio@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: Add a SSDT ACPI description to recognize my I2C device connected via SMBus
Date: Thu, 30 Sep 2021 00:40:35 +0200	[thread overview]
Message-ID: <e221dce908c5ebffa2970c918b45428d@dev.tdt.de> (raw)
In-Reply-To: <CAHp75Vcc_6mcR4gC-MzVTjTBpuozMJMFTosQjpXN8A25pndNpg@mail.gmail.com>


> The mcp23s08 can not be connected to I2C. It's a SPI device.
> Which chip do you actually have? I believe it's MCP23017 or MCP23018,
> which is I2C.

Yes the device is a mcp23017, but the driver is the pinctrl_mcp23s08 [1]

root@dev ~ # lsmod | grep mcp
pinctrl_mcp23s08       16384  0
regmap_core            45056  1 pinctrl_mcp23s08,[permanent]

> Summary:
> 1) _CID notation is wrong in ASL;

I got it

> 2) driver seems supports the _ADR schema which you have used in ASL;

This refers to the i2c-0, doesn't it?
My mcp23s08 device is located at the i2c-0 on address 0x24.

> 3) something fishy about I/O addresses in the sysfs (is it a typo when
> you composed the email?);

No

I have asked myself the same question.
Something is not right.
There was a change regarding the Hudson2 in the driver, maybe something 
went wrong [2]?

> 4) it's unclear what you did with ASL to get it loaded;

On my development device I did a `iasl dsl/mcp23017.dsl`
Of the following dsl

$ cat dsl/mcp23017.dsl
DefinitionBlock ("mcp23017.aml", "SSDT", 5, "", "MCP23017", 4)
{
     External (\_SB.PCI0.SBUS, DeviceObj)

     Scope (\_SB.PCI0.SBUS)
     {
         Device (GPIO)
         {
             Name (_HID, "PRP0001")
             Name (_DDN, "MCP23017 gpio expander")
             Name (_ADR, Zero)
             Name (_CRS, ResourceTemplate () {
                 I2cSerialBus (
                     0x24,                   // Bus address
                     ControllerInitiated,    // Don't care
                     400000,                 // Fast mode (400 kHz)
                     AddressingMode7Bit,     // 7-bit addressing
                     "\\_SB.PCI0.SBUS",      // I2C host controller
                     0                       // Must be 0
                 )
             })

             Name (_DSD, Package () {
                 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                 Package () {
                     Package () { "compatible", Package () { 
"microchip,mcp23017" } },
                 }
             })
         }
     }
}

After that I copied this to my APU3 Target and executed
  the following commands:
mkdir /sys/kernel/config/acpi/table/mcp23017

cat mcp23s08.aml > /sys/kernel/config/table/mcp23017

> 5) as Mika suggested, have you checked the kernel configuration?

I have now switched on the suggested option
CONFIG_ACPI_CUSTOM_METHOD=y
CONFIG_ACPI_TABLE_UPGRADE=y
CONFIG_CONFIGFS_FS=y
CONFIG_ACPI_CONFIGFS=y
CONFIG_ACPI_DEBUG=y

But this did not solved my issue loading ssdt during runtime.

The output of the aml on the target:

cat /sys/kernel/config/acpi/table/mcp23017/aml
SSDTsMCP23017INTL \/_SB_PCI0SBUSK
                                  \/_SB_PCI0SBUS[H
MCP23017 gpio expande_AD_CRS&
#$\_SB.PCI0.SBUS_DSD?
microchip,mcp23017


My iasl version:

iasl --version
Illegal option: --

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20181213
Copyright (c) 2000 - 2018 Intel Corporation


What else can I do?
The initrd option does not work with OpenWrt.
Maybe I can get further if you can give me a good HEX for debug_level 
and the debug_layer?

---
Regards Florian

[1] 
https://github.com/torvalds/linux/blob/master/drivers/pinctrl/pinctrl-mcp23s08_i2c.c
[2] 
https://github.com/torvalds/linux/commit/528d53a1592b0e27c423f7cafc1df85f77fc1163#diff-aa95f6311d1fcc4d85955b153a2510e853807546ac8e0d3aa0310ac30d236147

  parent reply	other threads:[~2021-09-29 22:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 17:38 [PATCH v1 1/9] pinctrl: mcp23s08: Get rid of legacy platform data Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 2/9] pinctrl: mcp23s08: Deduplicate IRQ chip filling Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 3/9] pinctrl: mcp23s08: Consolidate SPI and I²C code Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 4/9] pinctrl: mcp23s08: Drop unused parameter in mcp23s08_probe_one() Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 5/9] pinctrl: mcp23s08: Refactor mcp23s08_spi_regmap_init() Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 6/9] pinctrl: mcp23s08: Propagate error code from device_property_read_u32() Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 7/9] pinctrl: mcp23s08: Make use of device properties Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 8/9] pinctrl: mcp23s08: Use for_each_set_bit() and hweight_long() Andy Shevchenko
2020-04-07 17:38 ` [PATCH v1 9/9] pinctrl: mcp23s08: Split to three parts: core, I²C, SPI Andy Shevchenko
2020-04-16 10:35 ` [PATCH v1 1/9] pinctrl: mcp23s08: Get rid of legacy platform data Linus Walleij
2020-10-09  9:15   ` Martin Hundebøll
2020-10-09 14:02     ` Andy Shevchenko
2020-10-09 16:02       ` Andy Shevchenko
2021-09-16 12:51 ` Florian Eckert
2021-09-22  6:36   ` Andy Shevchenko
2021-09-22  7:53     ` Andy Shevchenko
2021-09-23 14:17       ` Add a SSDT ACPI description to recognize my I2C device connected via SMBus Florian Eckert
2021-09-23 16:24         ` Mika Westerberg
2021-09-23 20:26         ` Andy Shevchenko
2021-09-23 20:29           ` Andy Shevchenko
2021-09-29 22:40           ` Florian Eckert [this message]
2021-09-30  6:15             ` Andy Shevchenko
2021-09-30  6:19               ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e221dce908c5ebffa2970c918b45428d@dev.tdt.de \
    --to=fe@dev.tdt.de \
    --cc=Eckert.Florian@googlemail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=info@metux.net \
    --cc=jdelvare@suse.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.