Commit Graph

9 Commits

Author SHA1 Message Date
Alok Chauhan
ffddff4695 i3c: master-qcom-geni: Configure i3c mode register
configure i3c mode gpio register to set pad mode
for scl and sda lines.

Change-Id: Ie0ad19def756fc4407cbbc580a997aa9ab984eac
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-05-14 12:50:02 -07:00
Alok Chauhan
53a31eabd0 i3c: master-qcom-geni: Add NULL pointer check
Add null pointer check while iterating over all
I3C device present on the bus before reading
device information in DAA sequence.

Change-Id: I36ded06b51a3d330cf9e1fe85ea6314432a708ad
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-05-14 11:42:39 +05:30
Alok Chauhan
10426ae5ea i3c: master-qcom-geni: Log i3c state in error scenario
Log i3c registers status at the time of error. This will
help in debug.

Change-Id: If175248d28f015ec6b53a79cebb218e740a3e106
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-05-07 19:19:35 +05:30
Alok Chauhan
9d46c0e4fb i3c: master-qcom-geni: correct i3c timing configuration
Correct i3c high time period configuration in Fast plus
mode.

Change-Id: I095aeff72b9f687b241d3599a1d03a826ea68160
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-05-07 19:16:00 +05:30
Alok Chauhan
81f04f4fdd i3c: Add a driver for Qualcomm GENI I3C master IP
Add a driver for Qualcomm GENI I3C master IP based on
proposed I3C framework.

Change-Id: Id12e8921ab4d73110fb973b8ccb432f616dc1591
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-03-18 12:30:02 +05:30
Jisheng Zhang
db35444180 i3c: fix missing detach if failed to retrieve i3c dev
If we failed to retrieve the i3c dev, we should detach the i3c dev
I.E i3c_master_detach_i3c_dev().

Change-Id: I4161ce67c99c9213d72f90a5369a8911c3f51432
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Git-commit: 093c61b6a0d5768f48442ec59d671496314cc47d
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-03-13 15:03:56 +05:30
Dan Carpenter
caabacf134 ic3: master: off by one in mode_show()
This should be >= ARRAY_SIZE() to avoid reading one element beyond the
end of the array.

Change-Id: Ia26f48d55f98a989c1ce2f23893f80e7a651855a
Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Git-commit: afe120c777b7a6aa23b8c8a5fedae9201a7ced0c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-03-13 15:03:14 +05:30
Dan Carpenter
0efb296128 i3c: fix an error code in i3c_master_add_i3c_dev_locked()
We should return "ret" as-is.  The "newdev" variable is a valid pointer.

Change-Id: Ic7196271dc547363e899adb46be86e36af4fc92d
Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Git-commit: 840414ae59d8858bca0a704e7f9c910d661348d7
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-03-13 15:02:34 +05:30
Boris Brezillon
ace0c3c406 i3c: Add core I3C infrastructure
Add core infrastructure to support I3C in Linux and document it.

This infrastructure adds basic I3C support. Advanced features will be
added afterwards.

There are a few design choices that are worth mentioning because they
impact the way I3C device drivers can interact with their devices:

- all functions used to send I3C/I2C frames must be called in
  non-atomic context. Mainly done this way to ease implementation, but
  this is not set in stone, and if anyone needs async support, new
  functions can be added later on.
- the bus element is a separate object, but it's tightly coupled with
  the master object. We thus have a 1:1 relationship between i3c_bus
  and i3c_master_controller objects, and if 2 master controllers are
  connected to the same bus and both exposed to the same Linux instance
  they will appear as two distinct busses, and devices on this bus will
  be exposed twice.
- I2C backward compatibility has been designed to be transparent to I2C
  drivers and the I2C subsystem. The I3C master just registers an I2C
  adapter which creates a new I2C bus. I'd say that, from a
  representation PoV it's not ideal because what should appear as a
  single I3C bus exposing I3C and I2C devices here appears as 2
  different buses connected to each other through the parenting (the
  I3C master is the parent of the I2C and I3C busses).
  On the other hand, I don't see a better solution if we want something
  that is not invasive.

Missing features:
- I3C HDR modes are not supported
- no support for multi-master and the associated concepts (mastership
  handover, support for secondary masters, ...)
- I2C devices can only be described using DT because this is the only
  use case I have. However, the framework can easily be extended with
  ACPI and board info support
- I3C slave framework. This has been completely omitted, but shouldn't
  have a huge impact on the I3C framework because I3C slaves don't see
  the whole bus, it's only about handling master requests and generating
  IBIs. Some of the struct, constant and enum definitions could be
  shared, but most of the I3C slave framework logic will be different

Change-Id: Ia1a95de803228a57b1ee572f7bbe5cb81c7644e5
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Git-commit: 3a379bbcea0af6280e1ca0d1edfcf4e68cde6ee0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2019-03-13 15:01:42 +05:30