11 Mar, 2019

1 commit


21 Nov, 2018

1 commit


28 Oct, 2018

1 commit


04 Aug, 2018

2 commits

  • This patch adds support for STMicroelectronics STM32 ADC (analog to
    digital converter). It's originally based on Linux kernel v4.18-rcs
    drivers/iio/adc/stm32-adc*. It's composed of:
    - core driver (UCLASS_SIMPLE_BUS) manages common resources (clk, regu).
    - child drivers (UCLASS_ADC) declare each ADC, channels and handle
    conversions.
    This driver currently supports STM32H7 and STM32MP1 ADC.

    Signed-off-by: Fabrice Gasnier
    Reviewed-by: Simon Glass

    Fabrice Gasnier
     
  • device_get_supply_regulator() only needs to be called once.
    But each time there's call to adc_vxx_value() for instance, it calls
    adc_vxx_platdata_update() -> device_get_supply_regulator().

    So, move device_get_supply_regulator() to pre_probe() routine.

    This also allows vdd_supply/vss_supply to be provided directly from
    uc_pdata, e.g dt-binding variant like stm32-adc provide its own
    'vref-supply'.

    Signed-off-by: Fabrice Gasnier
    Reviewed-by: Simon Glass

    Fabrice Gasnier
     

19 Jun, 2018

1 commit


08 May, 2018

1 commit

  • This patch adds the driver for the Amlogic Meson Successive Approximation
    Register (SAR) A/D Converter based on the Linux IIO driver thanks to the
    great work of Martin Blumenstingl.
    The driver has been adapted to U-Boot and the ADC UClass.

    This patch depends on the regmap "regmap: add regmap_update_bits() helper"
    patch and has been tested using the newly introducted "adc" CLI command
    in the "cmd: add ADC cli commands" patch.

    Signed-off-by: Neil Armstrong

    Neil Armstrong
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

28 Apr, 2018

1 commit


04 Oct, 2017

1 commit

  • U-Boot widely uses error() as a bit noisier variant of printf().

    This macro causes name conflict with the following line in
    include/linux/compiler-gcc.h:

    # define __compiletime_error(message) __attribute__((error(message)))

    This prevents us from using __compiletime_error(), and makes it
    difficult to fully sync BUILD_BUG macros with Linux. (Notice
    Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

    Let's convert error() into now treewide-available pr_err().

    Done with the help of Coccinelle, excluing tools/ directory.

    The semantic patch I used is as follows:

    //
    @@@@
    -error
    +pr_err
    (...)
    //

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass
    [trini: Re-run Coccinelle]
    Signed-off-by: Tom Rini

    Masahiro Yamada
     

01 Oct, 2017

1 commit

  • The ADC can support some channels signal-ended some bits Successive Approximation
    Register (SAR) A/D Converter, like 6-channel and 10-bit. It converts the analog
    input signal into some bits binary digital codes.

    Signed-off-by: David Wu
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich

    David Wu
     

01 Jun, 2017

2 commits

  • Update the adc uclass to support a live device tree.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • These support the flat device tree. We want to use the dev_read_..()
    prefix for functions that support both flat tree and live tree. So rename
    the existing functions to avoid confusion.

    In the end we will have:

    1. dev_read_addr...() - works on devices, supports flat/live tree
    2. devfdt_get_addr...() - current functions, flat tree only
    3. of_get_address() etc. - new functions, live tree only

    All drivers will be written to use 1. That function will in turn call
    either 2 or 3 depending on whether the flat or live tree is in use.

    Note this involves changing some dead code - the imx_lpi2c.c file.

    Signed-off-by: Simon Glass

    Simon Glass
     

08 Feb, 2017

1 commit

  • At present devices use a simple integer offset to record the device tree
    node associated with the device. In preparation for supporting a live
    device tree, which uses a node pointer instead, refactor existing code to
    access this field through an inline function.

    Signed-off-by: Simon Glass

    Simon Glass
     

02 Nov, 2015

3 commits

  • This commit adds implementation of Sandbox ADC device emulation.
    The device provides:
    - single and multi-channel conversion
    - 4 channels with predefined conversion output data
    - 16-bit resolution

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds driver for Exynos54xx ADC subsystem.

    The driver is implemented using driver model, amd provides
    ADC uclass's methods for ADC single channel operations:
    - adc_start_channel()
    - adc_channel_data()
    - adc_stop()

    The basic parameters of ADC conversion, are:
    - sample rate: 600KSPS
    - output the data as average of 8 time conversion

    ADC features:
    - sample rate: 600KSPS
    - resolution: 12-bit
    - channels: 10 (analog multiplexer)

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds:
    - new uclass id: UCLASS_ADC
    - new uclass driver: drivers/adc/adc-uclass.c

    The new uclass's API allows for ADC operation on:
    * single-channel with channel selection by a number
    * multti-channel with channel selection by bit mask

    ADC uclass's functions:
    * single-channel:
    - adc_start_channel() - start channel conversion
    - adc_channel_data() - get conversion data
    - adc_channel_single_shot() - start/get conversion data
    * multi-channel:
    - adc_start_channels() - start selected channels conversion
    - adc_channels_data() - get conversion data
    - adc_channels_single_shot() - start/get conversion data for channels
    selected by bit mask
    * general:
    - adc_stop() - stop the conversion
    - adc_vdd_value() - positive reference Voltage value with polarity [uV]
    - adc_vss_value() - negative reference Voltage value with polarity [uV]
    - adc_data_mask() - conversion data bit mask

    The device tree can provide below constraints/properties:
    - vdd-polarity-negative: if true: Vdd = vdd-microvolts * (-1)
    - vss-polarity-negative: if true: Vss = vss-microvolts * (-1)
    - vdd-supply: phandle to Vdd regulator's node
    - vss-supply: phandle to Vss regulator's node
    And optional, checked only if the above corresponding, doesn't exist:
    - vdd-microvolts: positive reference Voltage [uV]
    - vss-microvolts: negative reference Voltage [uV]

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak