09 Aug, 2019

1 commit


24 May, 2019

2 commits

  • If a device has relevant power domain, we will check the power up
    result in probing the device. If the power up is failed, the device_probe
    will return failure immediately.

    The only exception is the new FLAG (DM_FLAG_IGNORE_POWER_ON) is set by driver
    to indicate ignore the power up result.

    Signed-off-by: Ye Li
    (cherry picked from commit 8524ca764d8fbd05da1593abfed62bb075c50cd4)

    Ye Li
     
  • Add a new driver FLAG (DM_FLAG_IGNORE_DEFAULT_CLKS). If any driver
    is set with this flag, then when probing the device, we will skip
    setting the default clocks.

    This is useful when clock driver can't work with some device driver.

    Signed-off-by: Ye Li

    Ye Li
     

20 Feb, 2019

1 commit


08 Feb, 2019

2 commits

  • It is wrapper for calling of_alias_get_highest_id() when live tree is
    enabled and fdtdec_get_alias_highest_id() if not.

    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Michal Simek
     
  • The same functionality was added to Linux for i2c bus registration with this
    commit message:

    "
    of: base: add function to get highest id of an alias stem

    I2C supports adding adapters using either a dynamic or fixed id. The
    latter is provided by aliases in the DT case. To prevent id collisions
    of those two types, install this function which gives us the highest
    fixed id, so we can then let the dynamically created ones come after
    this highest number.

    Signed-off-by: Wolfram Sang
    Acked-by: Rob Herring
    Signed-off-by: Wolfram Sang
    "

    Add it also to U-Boot for DM I2C support.

    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Michal Simek
     

03 Jan, 2019

1 commit


14 Dec, 2018

4 commits

  • The current dev_read...() functions use s32 and u32 which are convenient
    for device tree but not so useful for normal code, which often wants to
    use normal integers for values.

    Add a helper which supports returning an unsigned int. Also add signed
    versions of the unsigned readers.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The sound driver pulls together the audio codec and i2s drivers in order
    to actually make sounds. It supports setup() and play() methods. The
    sound_find_codec_i2s() function allows locating the linked codec and i2s
    devices. They can be referred to from uclass-private data.

    Add a uclass and a test for sound.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The i2s bus is commonly used with audio codecs. It provides a way to
    stream digital data sychronously in both directions. U-Boot only supports
    audio output, so this uclass is very simple, with a single tx_data()
    method.

    Add a uclass and a test for i2s.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • An audio codec provides a way to convert digital data to sound and vice
    versa. Add a simple uclass which just supports setting the parameters for
    the codec.

    Signed-off-by: Simon Glass

    Simon Glass
     

10 Dec, 2018

5 commits


07 Dec, 2018

2 commits


06 Dec, 2018

2 commits


05 Dec, 2018

2 commits


30 Nov, 2018

5 commits

  • Signed-off-by: Baruch Siach

    Baruch Siach
     
  • Sandbox i2c works using emulation drivers which are currently children of
    the i2c device:

    rtc_0: rtc@43 {
    reg = ;
    compatible = "sandbox-rtc";
    emul {
    compatible = "sandbox,i2c-rtc";
    };
    };

    In this case the emulation device is attached to i2c bus on address 0x43
    and provides the Real-Time-Clock (RTC) functionality.

    However this is not ideal, since every device on an I2C bus has a child
    device. This is only really the case for sandbox, but we want to avoid
    special-case code for sandbox.

    A better approach seems to be to add a separate node on the bus, an
    'emulation parent'. This can be given a bogus address (such as 0xff) and
    hides all the emulators away. Then we can use a phandle to point from the
    device to the correct emualtor, and only on sandbox. The code to find an
    emulator does not interfere with normal i2c operation.

    Add a new UCLASS_I2C_EMUL_PARENT uclass which allows finding an emulator
    given a bus, and finding a bus given an emulator. This will be used in a
    follow-on patch.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This is currently at the top in the space for internal use. But this
    uclass is used outside driver model and test code. Move it into the
    correct alpha order.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add two functions which can find a child device by uclass or by name.
    The first is useful with Multi-Function-Devices (MFDs) to find one of a
    particular type. The second is useful when only the name is known.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This function may be useful to code outside of the code driver-model
    implementation. Export it and add a test.

    Signed-off-by: Simon Glass

    Simon Glass
     

27 Nov, 2018

2 commits


26 Nov, 2018

1 commit


17 Nov, 2018

5 commits


15 Nov, 2018

5 commits

  • This adds a new virtio uclass driver for “virtio” [1] family of
    devices that are are found in virtual environments like QEMU,
    yet by design they look like physical devices to the guest.

    The uclass driver provides child_pre_probe() and child_post_probe()
    methods to do some common operations for virtio device drivers like
    device and driver supported feature negotiation, etc.

    [1] http://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.pdf

    Signed-off-by: Tuomas Tynkkynen
    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Add test case to cover uclass driver's child_post_probe() method.

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Some buses need to set up their child devices after they are probed.
    Support a common child_post_probe() method for the uclass.

    With this change, the two APIs uclass_pre_probe_device() and
    uclass_post_probe_device() become symmetric.

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • The pre_reloc_only parameter description currently only mentions
    drivers with the DM_FLAG_PRE_RELOC flag, but does not mention the
    special device tree properties. Correct them.

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Currently the comments of several APIs (eg: dm_init_and_scan()) say:

    @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
    flag. If false bind all drivers.

    The 'Pre-Relocation Support' chapter in doc/driver-model/README.txt
    documents the same that both device tree properties and driver flag
    are supported.

    However the implementation only checks these special device tree
    properties without checking the driver flag at all. This updates
    lists_bind_fdt() to consider both scenarios.

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass
    Squashed in http://patchwork.ozlabs.org/patch/996473/ :
    Signed-off-by: Simon Glass

    Bin Meng