The NetBSD Project

CVS log for src/sys/dev/i2c/gttwsi_core.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / i2c

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.18 / (download) - annotate - [select for diffs], Sat Aug 7 16:19:11 2021 UTC (2 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.17: +3 -4 lines
Diff to previous 1.17 (colored)

Merge thorpej-cfargs2.

Revision 1.17.8.1 / (download) - annotate - [select for diffs], Wed Aug 4 18:53:26 2021 UTC (2 years, 8 months ago) by thorpej
Branch: thorpej-cfargs2
Changes since 1.17: +3 -4 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Adapt to CFARGS().

Revision 1.17 / (download) - annotate - [select for diffs], Sat Apr 24 23:36:54 2021 UTC (2 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-cfargs2
Changes since 1.16: +5 -3 lines
Diff to previous 1.16 (colored)

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

Revision 1.16.8.1 / (download) - annotate - [select for diffs], Fri Apr 2 22:17:44 2021 UTC (3 years ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.16: +5 -3 lines
Diff to previous 1.16 (colored) next main 1.17 (colored)

config_found_ia() -> config_found() w/ CFARG_IATTR.

Revision 1.7.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:05 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.7.2.1: +56 -93 lines
Diff to previous 1.7.2.1 (colored) to branchpoint 1.7 (colored) next main 1.8 (colored)

Merge changes from current as of 20200406

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:08 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.10.2.1: +9 -2 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored)

Sync with head.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Feb 15 23:42:01 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Branch point for: thorpej-cfargs
Changes since 1.15: +9 -2 lines
Diff to previous 1.15 (colored)

Interrupt-driven I/O seems to completely go off the rails, at least
on AllWinner implementations of this controller, so force polled mode
for now.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:31 2020 UTC (4 years, 3 months ago) by ad
Branch: ad-namecache
Changes since 1.10: +49 -49 lines
Diff to previous 1.10 (colored)

Sync with head.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jan 13 12:53:46 2020 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Fix silly mistake in rev 1.12.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jan 13 09:53:54 2020 UTC (4 years, 3 months ago) by martin
Branch: MAIN
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

Fix debug printf formats.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jan 13 00:09:28 2020 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.12: +35 -20 lines
Diff to previous 1.12 (colored)

Improve diagnostic messages:
- Pass an additional argument to gttwsi_wait() to indicate what's
  going on, and report that, along with the error code from
  cv_timedwait(), if a timeout occurs.
- In gttwsi_send_stop(), if we don't get the expected NRS status,
  report which status we *did* get when a timeout occurs.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 12 17:48:42 2020 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.11: +14 -29 lines
Diff to previous 1.11 (colored)

Clean up gttwsi's register access stuff:
- Garbage-collect the obsolete GTTWSI_ALLWINNER option; it hasn't been
  needed since FDT'ization of the Allwinner support code.
- Redefine thw "TWSI_*" register definitions to clearly call out:
  -> The Marvell flavor of the offsets
  -> The Allwinner flavor of the offsets
  ...and make the regular definitions indices into a register map.
- Pass the appropriate register map from the front-end to the core.
- Remove the customer register read/write callbacks -- they are no longer
  needed now that each front-end passes an appropriate register map to
  the core.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 11 22:21:25 2020 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

In gttwsi_wait(), don't use cv_timedwait_sig() -- there's no reason to
catch signals here, and the code would need to handle them properly, which
this code does not.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Dec 25 14:08:47 2019 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.9: +2 -14 lines
Diff to previous 1.9 (colored)

Remove assertions that no longer make sense now that the bus acquire / release
logic is handled by the upper layer.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Dec 22 23:23:32 2019 UTC (4 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.8: +3 -35 lines
Diff to previous 1.8 (colored)

Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus().  "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().

Revision 1.7.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:09 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.7: +19 -12 lines
Diff to previous 1.7 (colored)

Sync with HEAD

Revision 1.3.2.3 / (download) - annotate - [select for diffs], Sat Oct 20 06:58:31 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.3.2.2: +19 -12 lines
Diff to previous 1.3.2.2 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with head

Revision 1.2.12.1 / (download) - annotate - [select for diffs], Mon Oct 15 03:09:07 2018 UTC (5 years, 6 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.2: +74 -30 lines
Diff to previous 1.2 (colored) next main 1.3 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1061):
	sys/dev/i2c/gttwsi_core.c: revision 1.4-1.8 via patch
	sys/dev/i2c/gttwsivar.h: revision 1.4 via patch
Use IPL_VM for bus lock so we can do i2c xfers from interrupt context
Don't sleep with IPL_VM lock held.
When initiating a transfer, if a device isn't present, we won't
get an ACK after sending the address.  Check for this alternate
state and suppress the error message when it occurs.
Fixes PR kern/53356.
Bail early if gttwsi_send_start() fails in gttwsi_initiate_xfer() to
avoid unexpected state error message later (on Allwinner H5).
Expand code covered by sc->sc_mtx, to make sure an interrupt would not be
handled before the cv_timedwait_sig() call, or while polling.
Seems to fix "sunxitwi0: send STOP failed" messages frequently seen related
to axp20x0 sensors.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 1 09:39:20 2018 UTC (5 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2
Changes since 1.7: +19 -12 lines
Diff to previous 1.7 (colored)

Expand code covered by sc->sc_mtx, to make sure an interrupt would not be
handled before the cv_timedwait_sig() call, or while polling.
Seems to fix "sunxitwi0: send STOP failed" messages frequently seen related
to axp20x0 sensors.

Revision 1.3.2.2 / (download) - annotate - [select for diffs], Mon Jun 25 07:25:50 2018 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.3.2.1: +35 -18 lines
Diff to previous 1.3.2.1 (colored) to branchpoint 1.3 (colored)

Sync with HEAD

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jun 18 12:42:29 2018 UTC (5 years, 10 months ago) by jakllsch
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi
Changes since 1.6: +5 -3 lines
Diff to previous 1.6 (colored)

Bail early if gttwsi_send_start() fails in gttwsi_initiate_xfer() to
avoid unexpected state error message later (on Allwinner H5).

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jun 12 13:18:48 2018 UTC (5 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +32 -17 lines
Diff to previous 1.5 (colored)

When initiating a transfer, if a device isn't present, we won't
get an ACK after sending the address.  Check for this alternate
state and suppress the error message when it occurs.

Fixes PR kern/53356.

Revision 1.3.2.1 / (download) - annotate - [select for diffs], Mon May 21 04:36:05 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.3: +18 -10 lines
Diff to previous 1.3 (colored)

Sync with HEAD

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 7 15:03:19 2018 UTC (5 years, 11 months ago) by jmcneill
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.4: +17 -9 lines
Diff to previous 1.4 (colored)

Don't sleep with IPL_VM lock held.

Revision 1.4 / (download) - annotate - [select for diffs], Thu May 3 02:08:52 2018 UTC (5 years, 11 months ago) by jmcneill
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Use IPL_VM for bus lock so we can do i2c xfers from interrupt context

Revision 1.1.12.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:02 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.1.12.2: +39 -3 lines
Diff to previous 1.1.12.2 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

update from HEAD

Revision 1.3 / (download) - annotate - [select for diffs], Sun Oct 29 14:59:05 2017 UTC (6 years, 5 months ago) by jmcneill
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.2: +31 -4 lines
Diff to previous 1.2 (colored)

Allow drivers to provide their own read/write register functions. While
here, sprinkle KASSERTs to verify that the i2c lock is held where it
should be.

Revision 1.1.10.1 / (download) - annotate - [select for diffs], Tue Nov 25 07:49:22 2014 UTC (9 years, 4 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Changes since 1.1: +12 -3 lines
Diff to previous 1.1 (colored) next main 1.2 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #257):
	sys/arch/arm/allwinner/awin_twi.c: revision 1.5
	sys/arch/arm/allwinner/awin_reg.h: revision 1.53
	sys/arch/evbarm/conf/HUMMINGBIRD_A31: revision 1.20
	sys/dev/i2c/gttwsi_core.c: revision 1.2
	sys/dev/i2c/gttwsivar.h: revision 1.2
On Allwinner A31 you need to set the CONTROL_IFLG bit to clear it. Add
a "iflg-rwc" property to enable this behaviour.
--
Don't assume that U-Boot has enabled the TWI clock. Also, for A31, set
the "iflg-rwc" device property for gttwsi.
--
The SoC RTC works on this board but does not seem to be hooked up to the
battery. Thankfully, there is a PCF8563 attached to TWI2 at address 51h,
so use that instead.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Nov 23 13:37:27 2014 UTC (9 years, 4 months ago) by jmcneill
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-8-base, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.1: +12 -3 lines
Diff to previous 1.1 (colored)

On Allwinner A31 you need to set the CONTROL_IFLG bit to clear it. Add
a "iflg-rwc" property to enable this behaviour.

Revision 1.1.12.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:37 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.1.12.1: +353 -0 lines
Diff to previous 1.1.12.1 (colored) to branchpoint 1.1 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.1.8.2 / (download) - annotate - [select for diffs], Thu May 22 11:40:21 2014 UTC (9 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.1.8.1: +353 -0 lines
Diff to previous 1.1.8.1 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.1.6.2 / (download) - annotate - [select for diffs], Sun May 18 17:45:37 2014 UTC (9 years, 11 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.1.6.1: +353 -0 lines
Diff to previous 1.1.6.1 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

sync with head

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Mon Mar 24 18:48:52 2014 UTC (10 years ago) by matt
Branch: matt-nb5-mips64
Changes since 1.1.2.1: +353 -0 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Merge mvi2c from HEAD

Revision 1.1.12.1, Fri Sep 6 00:56:12 2013 UTC (10 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.1: +0 -353 lines
FILE REMOVED

file gttwsi_core.c was added on branch tls-maxphys on 2014-08-20 00:03:37 +0000

Revision 1.1.8.1, Fri Sep 6 00:56:12 2013 UTC (10 years, 7 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.1: +0 -353 lines
FILE REMOVED

file gttwsi_core.c was added on branch yamt-pagecache on 2014-05-22 11:40:21 +0000

Revision 1.1.6.1, Fri Sep 6 00:56:12 2013 UTC (10 years, 7 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.1: +0 -353 lines
FILE REMOVED

file gttwsi_core.c was added on branch rmind-smpnet on 2014-05-18 17:45:37 +0000

Revision 1.1.2.1, Fri Sep 6 00:56:12 2013 UTC (10 years, 7 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.1: +0 -353 lines
FILE REMOVED

file gttwsi_core.c was added on branch matt-nb5-mips64 on 2014-03-24 18:48:52 +0000

Revision 1.1 / (download) - annotate - [select for diffs], Fri Sep 6 00:56:12 2013 UTC (10 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, netbsd-7-base
Branch point for: yamt-pagecache, tls-maxphys, rmind-smpnet, netbsd-7, matt-nb5-mips64

Make gttswi MI and usuable from non-Marvell SoCs.
(should rename to mvi2c but ...)

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>