Commit graph

16 commits

Author SHA1 Message Date
Maureen Helm
eb43207508 disk: Remove unused variables in nxp usdhc driver
Removes unused instances of struct usdhc_priv in the nxp usdhc driver.
The DISK_ACCESS_USDHC_INIT macro is responsible for instantiating these
variables.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
04f2ab9af1 disk: Remove extra copy of config struct in nxp usdhc driver
Updates the nxp usdhc driver data structure to keep a reference instead
of a copy of the constant config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
6fa92fe7da disk: Move variable from config to data struct in nxp usdhc driver
Moves the source clock frequency variable in the nxp usdhc driver from
the config structure to the data structure in preparation for removing
the writable copy of the config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
ec53518fa5 disk: Remove instance conditionals from nxp usdhc driver functions
Refactors the nxp usdhc driver to remove instance-specific conditionals
from driver functions. Now all instance-specific details, such as power
and card detect gpios, are contained in the driver config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
47463173c7 disk: Create device instance macro in nxp usdhc driver
Creates a new device instance macro in the nxp usdhc driver to use with
DT_INST_FOREACH.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Martí Bolívar
6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Tomasz Bursztyka
97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
Kumar Gala
fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Kumar Gala
646f12383a disk: convert DT_NODE_HAS_PROP(..,label) to DT_HAS_NODE()
The check for label property is really checking to see if a device
exists and the better way to do that is to use DT_HAS_NODE().  Replace
refernces of DT_NODE_HAS_PROP(DT_INST(...), label) with
DT_HAS_NODE(DT_INST(...)).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 11:34:50 -05:00
Kumar Gala
b2f13ccddf disk: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:06:40 -05:00
Peter Bigot
37239dbcbf gpio: rename typedef for devicetree flags
gpio_dt_flags_t is shorter and consistent with DT_ prefix.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Maureen Helm
4b29b9faec disk: Convert usdhc driver to new gpio api
Converts the usdhc driver to the new gpio api. Updates the
device tree for the mimxrt1050_evk board to set appropriate active
high/low polarity for the power and card detect pins.

Note that the driver doesn't actually support interrupts yet. It
initializes a gpio callback for the card detect pin, but never actually
enables the gpio interrupt. This incomplete behavior is left as-is,
since the purpose of this patch is only to convert the driver to the new
gpio api, not to add new features.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Ulf Magnusson
984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Maureen Helm
aa9b762d12 disk: Fix usdhc driver out-of-bounds array access
The usdhc driver was incorrectly post-decrementing a do/while loop
iterator, causing an extra iteration of the loop and an out-of-bounds
array access. Change the iterator to decrement within the loop instead.

Tested samples/subsys/fs/fat_fs on the mimxrt1050_evk board.

Coverity-CID: 203403

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-08-30 16:57:55 +02:00
Jun Yang
da3765abc5 usdhc: support NXP i.MXRT usdhc
support NXP i.MXRT usdhc for file system to access.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00