1. 17 Jun, 2013 40 commits
    • Tomi Valkeinen's avatar
      OMAPDSS: Add new Analog TV Connector driver · 61a7f24a
      Tomi Valkeinen authored
      Add Analog TV Connector driver which uses the new DSS device model and
      DSS ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      61a7f24a
    • Tomi Valkeinen's avatar
      OMAPDSS: Add new HDMI Connector driver · 3cb07ee6
      Tomi Valkeinen authored
      Add HDMI Connector driver which uses the new DSS device model and DSS
      ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      3cb07ee6
    • Tomi Valkeinen's avatar
      OMAPDSS: Add new DVI Connector driver · 348077b1
      Tomi Valkeinen authored
      Add DVI Connector driver which uses the new DSS device model and DSS
      ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      348077b1
    • Tomi Valkeinen's avatar
      OMAPDSS: Add new TPD12S015 Encoder driver · a0ee577f
      Tomi Valkeinen authored
      Add TPD12S015 HDMI ESD protection and level shifter encoder driver which
      uses the new DSS device model and DSS ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      a0ee577f
    • Tomi Valkeinen's avatar
      OMAPDSS: Add new TFP410 Encoder driver · 2773fefb
      Tomi Valkeinen authored
      Add TFP410 DPI-to-DVI Encoder driver which uses the new DSS device
      model and DSS ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      2773fefb
    • Tomi Valkeinen's avatar
      OMAPDSS: DSI: Add ops · deb16df8
      Tomi Valkeinen authored
      Add "ops" style method for using DSI functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      deb16df8
    • Tomi Valkeinen's avatar
      OMAPDSS: HDMI: Add ops · 0b450c31
      Tomi Valkeinen authored
      Add "ops" style method for using HDMI functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      0b450c31
    • Tomi Valkeinen's avatar
      OMAPDSS: AnalogTV: Add ops · fb8efa49
      Tomi Valkeinen authored
      Add "ops" style method for using analog TV functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      fb8efa49
    • Tomi Valkeinen's avatar
      OMAPDSS: DVI: Add ops · 7700c2d4
      Tomi Valkeinen authored
      Add "ops" style method for using DVI functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7700c2d4
    • Tomi Valkeinen's avatar
      OMAPDSS: SDI: Add ops · b1082dfd
      Tomi Valkeinen authored
      Add "ops" style method for using SDI functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b1082dfd
    • Tomi Valkeinen's avatar
      OMAPDSS: DPI: Add ops · 0b24edb1
      Tomi Valkeinen authored
      Add "ops" style method for using DPI functionality.
      
      Ops style calls will allow us to have arbitrarily long display
      pipelines, where each entity can call ops in the previous display
      entity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      0b24edb1
    • Tomi Valkeinen's avatar
      drm/omap: DVI connector fix · 4635c17d
      Tomi Valkeinen authored
      The omapdrm driver currently uses a string comparison to find out if the
      display is a DVI display. This is not reliable, and as we now have a
      specific display type for DVI, let's use that.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      4635c17d
    • Tomi Valkeinen's avatar
      OMAPDSS: add OMAP_DISPLAY_TYPE_DVI · bc24b8b6
      Tomi Valkeinen authored
      Add new display bus type for DVI. This is not used by omapdss driver
      itself, but is used by external encoder chips that output DVI.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      bc24b8b6
    • Tomi Valkeinen's avatar
      OMAPDSS: modify get/find functions to go through the device chain · efedce14
      Tomi Valkeinen authored
      In the future will have arbitrarily long video pipeline chains, instead
      of the current two-entities-per-pipeline model.
      
      This patch changes the affected get/find style functions so that they
      properly go through the video pipeline chain, for example when getting
      the overlay manager connected to a given display.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      efedce14
    • Tomi Valkeinen's avatar
      OMAPDSS: public omapdss_register_output() · 5d47dbc8
      Tomi Valkeinen authored
      In order to allow multiple display block in a video pipeline, we need to
      give the drivers way to register themselves. For now we have
      the omapdss_register_display() which is used to register panels, and
      dss_register_output() which is used to register DSS encoders.
      
      This patch makes dss_register_output() public (with the name of
      omapdss_register_output), which can be used to register also external
      encoders. The distinction between register_output and register_display
      is that a "display" is an entity at the end of the videopipeline, and
      "output" is something inside the pipeline.
      
      The registration and naming will be made saner in the future, but the
      current names and functions are kept to minimize changes during the dss
      device model transition.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5d47dbc8
    • Sergey Kibrik's avatar
      OMAPDSS: gracefully disable overlay at error · 595470a7
      Sergey Kibrik authored
      Disable overlay via ovl->disable() interface, which will
      properly set flags in cache and GO bits for managers.
      This allows overlay user to re-enable it on next frame,
      thus recovering from FIFO underflows.
      Signed-off-by: default avatarSergey Kibrik <sergiikibrik@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      595470a7
    • Emil Goode's avatar
      OMAPDSS: Remove kfree for memory allocated with devm_kzalloc · b0e449ce
      Emil Goode authored
      It's not necessary to free memory allocated with devm_kzalloc
      in a remove function and using kfree leads to a double free.
      Signed-off-by: default avatarEmil Goode <emilgoode@gmail.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b0e449ce
    • Tomi Valkeinen's avatar
      OMAPDSS: remove dispc's dependency to VENC/HDMI · 5391e87d
      Tomi Valkeinen authored
      DISPC needs to know the clock rate for DIGIT (i.e. TV) channel, and this
      clock is provided by either VENC or HDMI modules. Currently DISPC will
      call a function in VENC/HDMI, asking what the clock rate is. This means
      we have a fixed dependency from DISPC to both VENC and HDMI.
      
      To have a more generic approach, and in particular to allow adding OMAP5
      HDMI driver, we need to remove this dependency. This patch makes
      VENC/HDMI inform DISPC when the their clock changes, thus reversing the
      dependency and removing the issue.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5391e87d
    • Tomi Valkeinen's avatar
      OMAPDSS: remove unused fields in omap_dss_device · 94954fcb
      Tomi Valkeinen authored
      The use of platform callbacks, backlight, DSI TE and reset gpio from the
      struct omap_dss_device has been removed. We can thus remove the fields
      from omap_dss_device.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      94954fcb
    • Tomi Valkeinen's avatar
      OMAPDSS: HDMI clean up hpd_gpio · 29356be1
      Tomi Valkeinen authored
      hpd_gpio is no longer used by the OMAP4 HDMI IP driver, and we can thus
      remove the unnecessary code.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      29356be1
    • Tomi Valkeinen's avatar
      OMAPDSS: HDMI: clean up PHY power handling · ddb1d5ca
      Tomi Valkeinen authored
      The TRM tells to set PHY to TXON only after getting LINK_CONNECT, and to
      set PHY to OFF or LDOON after getting LINK_DISCONNECT, in order to avoid
      damage to the PHY.
      
      We don't currently do it quite like that. Instead of using the HDMI
      interrupts, we use HPD signal. This works, but is not actually quite
      correct, as HPD comes at a different time than LINK_CONNECT and
      LINK_DISCONNECT interrupts. Also, the HPD GPIO is a property of the TPD
      level shifter, not HDMI IP, so handling the GPIO in the HDMI driver is
      wrong.
      
      This patch implements the PHY power handling correctly, using the
      interrupts.
      
      There is a corner case that causes some additional difficulties: we may
      get both LINK_CONNECT and LINK_DISCONNECT interrupts at the same time.
      This is handled in the code by retrying: turning off the PHY, clearing
      the interrupt status, and re-enabling the PHY. This causes a new
      LINK_CONNECT interrupt to happen if a cable is connected.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      ddb1d5ca
    • Tomi Valkeinen's avatar
      OMAPFB: use EPROBE_DEFER if default display is not present · e9f322b4
      Tomi Valkeinen authored
      Currently omapfb returns EPROBE_DEFER if no displays have been probed at
      the time omapfb is probed. However, sometimes some of the displays have
      been probed at that time, but not all. We can't return EPROBE_DEFER in
      that case, because then one missing driver would cause omapfb to defer
      always, preventing any display from working.
      
      However, if the user has defined a default display, we can presume that
      the driver for that display is eventually loaded. Thus, this patch
      changes omapfb to return EPROBE_DEFER in case default display is not
      found.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      e9f322b4
    • Tomi Valkeinen's avatar
      OMAPDSS: output: increase refcount in find_output funcs · 820caabf
      Tomi Valkeinen authored
      Now that omap_dss_output has been combined into omap_dss_device, we can
      add ref counting for the relevant output functions also.
      
      This patch adds omap_dss_get_device() calls to the various find_output()
      style functions. This, of course, means that the users of those
      find_output functions need to do a omap_dss_put_device() after use.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      820caabf
    • Tomi Valkeinen's avatar
      OMAPDSS: add THIS_MODULE owner to DSS outputs · b7328e14
      Tomi Valkeinen authored
      Setup the owner field for DSS output's omap_dss_device so that module
      refcounting works.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b7328e14
    • Tomi Valkeinen's avatar
      OMAPDSS: add module_get/put to omap_dss_get/put_device() · d35317a4
      Tomi Valkeinen authored
      omap_dss_get_device() should be called for omap_dss_device before it is
      used to increase its refcount. Currently we only increase the refcount
      for the underlying device.
      
      This patch adds managing the ref count to the underlying module also,
      which contains the ops for the omap_dss_device.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      d35317a4
    • Tomi Valkeinen's avatar
      OMAPDSS: omapdss.h: add owner field to omap_dss_device · 4f3e44ea
      Tomi Valkeinen authored
      Add struct module *owner field to omap_dss_device, which points to the
      module containing the ops for this omap_dss_device. This will be used to
      manage the ref count for the module.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      4f3e44ea
    • Tomi Valkeinen's avatar
      OMAPDSS: combine omap_dss_output into omap_dss_device · 1f68d9c4
      Tomi Valkeinen authored
      We currently have omap_dss_device, which represents an external display
      device, sometimes an external encoder, sometimes a panel. Then we have
      omap_dss_output, which represents DSS's output encoder.
      
      In the future with new display device model, we construct a video
      pipeline from the display blocks. To accomplish this, all the blocks
      need to be presented by the same entity.
      
      Thus, this patch combines omap_dss_output into omap_dss_device. Some of
      the fields in omap_dss_output are already found in omap_dss_device, but
      some are not. This means we'll have DSS output specific fields in
      omap_dss_device, which is not very nice. However, it is easier to just
      keep those output specific fields there for now, and after transition to
      new display device model is made, they can be cleaned up easier than
      could be done now.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      1f68d9c4
    • Tomi Valkeinen's avatar
      OMAPDSS: remove omap_dss_start/stop_device() · d3923933
      Tomi Valkeinen authored
      The omap_dss_start_device() and omap_dss_stop_device(), called by the
      DSS output drivers, are old relics. They originally did something
      totally else, but nowadays they increase the module ref count for panels
      that are enabled.
      
      This model is quite broken: the panel modules may be used even before
      they are enabled. For example, configuring the panel requires calls to
      functions located in the panel modules.
      
      In the following patches we try to improve the ref count management for
      the modules and display devices. The first step, however, is to remove
      the omap_dss_start/stop_device() totally.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      d3923933
    • Tomi Valkeinen's avatar
      OMAPDSS: Add panel dev pointer to dssdev · ecc8b370
      Tomi Valkeinen authored
      We are about to remove the dss bus support, which also means that the
      omap_dss_device won't be a real device anymore. This means that the
      embedded "dev" struct needs to be removed from omap_dss_device.
      
      After we've finished the removal of the dss bus, we see the following
      changes:
      
      - struct omap_dss_device won't be a real Linux device anymore, but more
        like a "display entity".
      - struct omap_dss_driver won't be a Linux device driver, but "display
        entity ops".
      - The panel devices/drivers won't be omapdss devices/drivers, but
        platform/i2c/spi/etc devices/drivers, whichever fits the control
        mechanism of the panel.
      - The panel drivers will create omap_dss_device and omap_dss_driver,
        fill the required fields, and register the omap_dss_device to
        omapdss.
      - omap_dss_device won't have an embedded dev struct anymore, but a
        dev pointer to the actual device that manages the omap_dss_device.
      
      The model described above resembles the model that has been discussed
      with CDF (common display framework).
      
      For the duration of the conversion, we temporarily have two devs in the
      dssdev, the old "old_dev", which is a full embedded device struct, and the
      new "dev", which is a pointer to the device. "old_dev" will be removed
      in the future.
      
      For devices belonging to dss bus the dev is initialized to point to
      old_dev. This way all the code can just use the dev, for both old and
      new style panels.
      
      Both the new and old style panel drivers work during the conversion, and
      only after the dss bus support is removed will the old style panels stop
      to compile.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      ecc8b370
    • Tomi Valkeinen's avatar
      OMAPDSS: implement display sysfs without dss bus · 94140f0d
      Tomi Valkeinen authored
      We aim to remove the custom omapdss bus totally, as it's quite a strange
      construct and won't be compatible with common display framework. One
      problem on the road is that we have sysfs files for each display, and
      they depend on the omapdss bus.
      
      This patch creates the display sysfs files independent of the omapdss
      bus. This gives us backwards compatibility without using the omapdss bus
      for the sysfs files.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      94140f0d
    • Tomi Valkeinen's avatar
      OMAPDSS: don't use dss bus in suspend/resume · a65c8bda
      Tomi Valkeinen authored
      We have support functions to suspend and resume all the displays that
      are used with system suspend. These functions use the dss bus to iterate
      the display devices.
      
      As we aim to remove the custom dss bus totally, this patch removes the
      explicit use of dss bus from these functions. Instead the
      for_each_dss_dev() macro is used to go through the devices.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      a65c8bda
    • Tomi Valkeinen's avatar
      OMAPDSS: use the panel list in omap_dss_get_next_device · 67b23ca1
      Tomi Valkeinen authored
      omap_dss_get_next_device() uses the dss bus to iterate over the
      displays. This patch changes omap_dss_get_next_device() to use the new
      panel list instead.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      67b23ca1
    • Tomi Valkeinen's avatar
      OMAPDSS: add panel list · 2e7e3dc7
      Tomi Valkeinen authored
      We currently use the omapdss bus (which contains all the available
      displays) to iterate the displays. As the omapdss bus is on its way out,
      this needs to be changed.
      
      Instead of using the dss bus to iterate displays, this patch adds our
      own list of displays which we manage. The panels on the dss bus are
      automatically added to this new list.
      
      An "alias" field is also added to omap_dss_device. This field is
      set to "display%d", the same way as omap_dss_device's dev name is set.
      This alias is later used to keep backward compatibility, when the
      embedded dev is no longer used.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      2e7e3dc7
    • Tomi Valkeinen's avatar
      OMAPDSS: remove dssdev uses in trivial cases · 7ae9a71e
      Tomi Valkeinen authored
      In the future the "dssdev" parameter passed to output drivers will
      change its meaning. Instead of being a pointer to the panel device, it's
      a pointer to the output instance.
      
      To make the transition easier, some of the uses for this dssdev
      parameter can be easily removed.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7ae9a71e
    • Tomi Valkeinen's avatar
      OMAPDSS: add videomode conversion support · 6fcd485b
      Tomi Valkeinen authored
      Add helper functions to convert between omapdss specific video timings
      and the common videomode.
      
      Eventually omapdss will be changed to use only the common video timings,
      and these helper functions will make the transition easier.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      6fcd485b
    • Tomi Valkeinen's avatar
      OMAPDSS: VENC: clean up regulator init · 7e436bb2
      Tomi Valkeinen authored
      Clean up the VENC driver's regulator init to remove the (unused)
      omap_dss_device parameter, renaming the function to a more sensible
      name, and making the code slightly clearer.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7e436bb2
    • Tomi Valkeinen's avatar
      OMAPDSS: SDI: fix regulators for DT · 46c4b645
      Tomi Valkeinen authored
      SDI requires a regulator to operate. This regulator is, for some reason,
      currently attached to the virtual omapdss device, instead of the SDI
      device. This does not work for DT, as the regulator mappings need to be
      described in the DT data, and the virtual omapdss device is not present
      there.
      
      Fix the issue by acquiring the regulator in the SDI device. To retain
      compatibility with the current board files, the old method of getting
      the regulator is kept. The old method can be removed when the board
      files have been changed to pass the regulator to SDI.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      46c4b645
    • Tomi Valkeinen's avatar
      OMAPDSS: SDI: clean up regulator init · d37801b3
      Tomi Valkeinen authored
      Clean up the SDI driver's regulator init to remove the (unused)
      omap_dss_device parameter, renaming the function to a more sensible
      name, and making the code slightly clearer.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      d37801b3
    • Tomi Valkeinen's avatar
      OMAPDSS: HDMI: add hdmi_init_regulator · e25001d8
      Tomi Valkeinen authored
      Separate regulator init code into its own function for clarity.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      e25001d8
    • Tomi Valkeinen's avatar
      OMAPDSS: DPI: fix regulators for DT · 00df43b8
      Tomi Valkeinen authored
      On some platforms DPI requires a regulator to be enabled to power up the
      output pins. This regulator is, for some reason, currently attached to
      the virtual omapdss device, instead of the DPI device. This does not
      work for DT, as the regulator mappings need to be described in the DT
      data, and the virtual omapdss device is not present there.
      
      Fix the issue by acquiring the regulator in the DPI device. To retain
      compatibility with the current board files, the old method of getting
      the regulator is kept. The old method can be removed when the board
      files have been changed to pass the regulator to DPI.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      00df43b8