linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: sergk sergk2mail <sergk.admin@gmail.com>, linux-i2c@vger.kernel.org
Subject: Re: I2c client driver + ACPI on Baytrail & kernel 4.4.2 = ?
Date: Mon, 14 Mar 2016 14:21:16 +0200	[thread overview]
Message-ID: <56E6ACBC.6010508@linux.intel.com> (raw)
In-Reply-To: <CA+V1LzrWqmx2GH6cs65mS=YHkvx+6wnnq7RpeYChH886pn5fog@mail.gmail.com>

Hi

On 03/13/2016 02:43 PM, sergk sergk2mail wrote:
> Hi All,
> Please help to correct create i2c client with ACPI support for device
> (touchscreen) on i2c on vanilla 4.4.2 kernel x86_64 Baytrail,
> disrtibutive = Arch.
> ========================================================
> According kernel Documentation I have created such skeleton:
>
>
> #define DEVICE_NAME  "testme"
>
> static const struct acpi_device_id icn_ts_acpi_match[] = {
>      { "CHPN0001", 0 },
>      { "PNP05C0", 0 },
>      { },
> };

Touchscreen and PNPxxxx: can it be i2c-hid compatible touchscreen?

Those typically have vendor specific ACPI _HID but device is matched 
using ACPI PNP compatible ID (_CID) "PNP0C50" or "ACPI0C50". See 
drivers/hid/i2c-hid/i2c-hid.c.

Just thinking if you have device with _CID "PNP0C50" and either device 
is matched before your driver with i2c-hid driver or your driver doesn't 
probe because "PNP05C0" != "PNP0C50".

> MAIN QUESTIONS:
>
> 1) What is wrong with i2c client driver code? Why it is NOT obtain
> info from ACPI DSD table?
>
Your example looks ok. Another what comes to my mind is the device 
actually present. Sometimes DSDT tables may specify multiple alternative 
devices but only one being actually connected. You could check that by 
reading the device status which reads 15 if the device is present.

cat /sys/bus/acpi/devices/ACPI01234/status
15

> 2) In which way should be created i2c dev while registering i2c acpi
> driver? Who\where\what and how should create this i2c device?
>
i2c-core registers the i2c devices connected to certain bus when adapter 
device for that bus is registered in i2c-core.c: i2c_register_adapter().

-- 
Jarkko

  reply	other threads:[~2016-03-14 12:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13 12:43 I2c client driver + ACPI on Baytrail & kernel 4.4.2 = ? sergk sergk2mail
2016-03-14 12:21 ` Jarkko Nikula [this message]
2016-03-15 22:26   ` sergk sergk2mail
2016-03-15 23:02     ` sergk sergk2mail
2016-03-15 23:12     ` sergk sergk2mail
2016-03-23  9:30       ` Jarkko Nikula

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=56E6ACBC.6010508@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=sergk.admin@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).