1. 05 11月, 2012 2 次提交
    • T
      OMAPDSS: DSI: workaround for HSDiv problem · 7a98786c
      Tomi Valkeinen 提交于
      It looks like on many OMAP versions powers for both HSClk and HSDiv to
      be enabled to have a functional HSDiv.
      
      This patch fixes the issue by forcing both powers on.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7a98786c
    • T
      OMAPDSS: DSI: skip odd dividers when pck >= 100MHz · b7f1fe54
      Tomi Valkeinen 提交于
      The DSI PLL and HSDivider can be used to generate the pixel clock for
      LCD overlay manager, which then goes to DPI output. On the DPI output
      pin the voltage of the signal is shifted from the OMAP's internal
      minimal voltage to 1.8V range. The shifting is not instant, and the
      higher the clock frequency, the less time there is to shift the signal
      to nominal voltage.
      
      If the HSDivider's divider is greater than one and odd, the resulting
      pixel clock does not have 50% duty cycle. For example, with a divider of
      3, the duty cycle is 33%.
      
      When combining high frequency (in the area of 140MHz+) and non-50% duty
      cycle, it has been observed the the shifter does not have enough time to
      shift the voltage enough, and this leads to bad signal which is rejected
      by monitors.
      
      As a workaround this patch makes the divider calculation skip all odd
      dividers when the required pixel clock is over 100MHz. The limit of
      100MHz is a guesstimate.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      b7f1fe54
  2. 29 10月, 2012 1 次提交
  3. 18 10月, 2012 1 次提交
    • T
      OMAPDSS: DSI: fix dsi_get_dsidev_from_id() · 78e7f256
      Tomi Valkeinen 提交于
      If dsi_get_dsidev_from_id() is called with a DSI module id that does not
      exist on the board, the function will crash as omap_dss_get_output()
      will return NULL.
      
      This happens on omap3 boards when dumping DSI clocks, as the dumping
      code will try to get the dsidev for DSI modules 0 and 1, but omap3 only
      has DSI module 0.
      
      Also clean up the id -> output mapping, so that if the function is
      called with invalid module ID it will return NULL.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Archit Taneja <archit@ti.com>
      78e7f256
  4. 12 10月, 2012 3 次提交
  5. 26 9月, 2012 5 次提交
    • A
      OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references · eea8340a
      Archit Taneja 提交于
      With addition of output entities, a device connects to an output, and an output
      connects to overlay manager. Replace the dssdev->manager references with
      dssdev->output->manager to access the manager correctly.
      
      When enabling the DSI output, check whether the output entity connected to
      display is not NULL.
      
      In dsi_init_display(), the display won't be connected to the DSI output yet,
      that happens later in dss_recheck_connections() in the panel driver's probe. Get
      the dsidev platform device pointer using the DSI moudle number provided in the
      omap_dss_device struct.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      eea8340a
    • A
      OMAPDSS: DSI: Remove dsi_pdev_map global struct · 400e65d1
      Archit Taneja 提交于
      dsi_pdev_map is a struct visible globally in the DSI driver to get the platform
      device pointer of the DSI device corresponding to it's module ID. This was
      required because there was no clean way to derive the platform device from
      the DSI module instance number or from the connected panel.
      
      With the new output entity, it is possible to retrieve the platform device
      pointer if the omap_dss_output pointer is available. Modify the functions
      dsi_get_dsidev_from_dssdev() dsi_get_dsidev_from_id() so that they use output
      instead of dsi_pdev_map to retrieve the dsi platform device pointer.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      400e65d1
    • A
      OMAPDSS: outputs: Create and register output instances · 81b87f51
      Archit Taneja 提交于
      Add output structs to output driver's private data. Register output instances by
      having an init function in the probes of the platform device drivers for
      different outputs. The *_init_output for each output registers the output and
      fill up the output's plaform device, type and id fields. The *_uninit_output
      functions unregister the output.
      
      In the probe of each interface driver, the output entities are initialized
      before the *_probe_pdata() functions intentionally. This is done to ensure that
      the output entity is prepared before the panels connected to the output are
      registered. We need the output entities to be ready because OMAPDSS will try
      to make connections between overlays, managers, outputs and devices during the
      panel's probe.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      81b87f51
    • A
      OMAPDSS: DSI: Pass dsi platform device wherever possible · 9e7e9372
      Archit Taneja 提交于
      Many of the DSI functions receive the connected panel's omap_dss_device pointer
      as an argument. The platform device pointer is then derived via omap_dss_device
      pointers.
      
      Most of these functions don't really require omap_dss_device pointer anymore
      since we now keep copies of parameters in the driver data which were previously
      available only via omap_dss_device. Replace the arguments with platform device
      pointers for such functions.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      9e7e9372
    • T
      OMAPDSS: DSI: fix tlpx_half reg field length · e84dc1cc
      Tomi Valkeinen 提交于
      tlpx_half bit field in DSI_DSIPHY_CFG1 is [20,16], not [22,16] as
      accessed in the code currently. Fix this.
      
      The bug should not have caused any problems on OMAP3/4, as the bits
      21,22 are unused. They are used on OMAP5, though.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      e84dc1cc
  6. 24 9月, 2012 5 次提交
  7. 18 9月, 2012 3 次提交
    • T
      OMAPDSS: alloc dssdevs dynamically · 5274484b
      Tomi Valkeinen 提交于
      We currently create omap_dss_devices statically in board files, and use
      those devices directly in the omapdss driver. This model prevents us
      from having the platform data (which the dssdevs in board files
      practically are) as read-only, and it's also different than what we will
      use with device tree.
      
      This patch changes the model to be in line with DT model: we allocate
      the dssdevs dynamically, and initialize them according to the data in
      the board file's dssdev (basically we memcopy the dssdev fields).
      
      The allocation and registration is done in the following steps in the
      output drivers:
      
      - Use dss_alloc_and_init_device to allocate and initialize the device.
        The function uses kalloc and device_initialize to accomplish this.
      - Call dss_copy_device_pdata to copy the data from the board file's
        dssdev
      - Use dss_add_device to register the device.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5274484b
    • T
      OMAPDSS: register only one display device per output · 1521653c
      Tomi Valkeinen 提交于
      We have boards with multiple panel devices connected to the same
      physical output, of which only one panel can be enabled at one time.
      Examples of these are Overo, where you can use different daughter boards
      that have different LCDs, and 3430SDP which has an LCD and a DVI output
      and a physical switch to select the active display.
      
      These are supported by omapdss so that we add all the possible display
      devices at probe, but the displays are inactive until somebody enables
      one. At this point the panel driver starts using the DSS, thus reserving
      the physcal resource and excluding the other panels.
      
      This is problematic:
      - Panel drivers can't allocate their resources properly at probe(),
        because the resources can be shared with other panels. Thus they can
        be only reserved at enable time.
      - Managing this in omapdss is confusing. It's not natural to have
        child devices, which may not even exist (for example, a daughterboard
        that is not connected).
      
      Only some boards have multiple displays per output, and of those, only
      very few have possibility of switching the display during runtime.
      Because of the above points:
      - We don't want to make omapdss and all the panel drivers more complex
        just because some boards have complex setups.
      - Only few boards support runtime switching, and afaik even then it's
        not required. So we don't need to support runtime switching.
      
      Thus we'll change to a model where we will have only one display device
      per output and this cannot be (currently) changed at runtime. We'll
      still have the possibility to select the display from multiple options
      during boot with the default display option.
      
      This patch accomplishes the above by changing how the output drivers
      register the display device. Instead of registering all the devices
      given from the board file, we'll only register one. If the default
      display option is set, the output driver selects that display from its
      displays. If the default display is not set, or the default display is
      not one of the output's displays, the output driver selects the first
      display.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      1521653c
    • T
      OMAPDSS: omap_dss_register_device() doesn't take display index · 8768a52f
      Tomi Valkeinen 提交于
      We used to have all the displays of the board in one list, and we made a
      "displayX" directory in the sysfs, where X was the index of the display
      in the list.
      
      This doesn't work anymore with device tree, as there's no single list to
      get the number from, and it doesn't work very well even with non-DT as
      we need to do some tricks to get the index nowadays.
      
      This patch changes omap_dss_register_device() so that it doesn't take
      disp_num as a parameter anymore, but uses a private increasing counter
      for the display number.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      8768a52f
  8. 08 9月, 2012 3 次提交
    • T
      OMAPDSS: remove unnecessary includes · fe6a4662
      Tomi Valkeinen 提交于
      Remove unnecessary includes from omapdss.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      fe6a4662
    • T
      OMAPDSS: fix use of dssdev->caps · ab585254
      Tomi Valkeinen 提交于
      Recent commit dca2b152 (OMAPDSS: DSI:
      Maintain copy of operation mode in driver data) broke DSI for video mode
      displays. The commit changed the way dssdev->caps are initialized, and
      the result was that every DSI display is initialized with manual-update
      and tear-elim caps.
      
      The code that sets dssdev->caps is not very good, even when fixed.
      omapdss driver shouldn't be writing dssdev->caps at all.
      
      This patch fixes the problem with video mode displays by moving the
      initialization of dssdev->caps to the panel driver. The same change is
      done for RFBI.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ab585254
    • T
      OMAPDSS: DSI: calculate dsi clock · ee144e64
      Tomi Valkeinen 提交于
      Currently the way to configure clocks related to DSI (both DSI and DISPC
      clocks) happens via omapdss platform data. The reason for this is that
      configuring the DSS clocks is a very complex problem, and it's
      impossible for the SW to know requirements about things like
      interference.
      
      However, for general cases it should be fine to calculate the dividers
      for clocks in the SW. The calculated clocks are probably not perfect,
      but should work.
      
      This patch adds support to calculate the dividers when using DSI command
      mode panels. The panel gives the required DDR clock rate and LP clock
      rate, and the DSI driver configures itself and DISPC accordingly.
      
      This patch is somewhat ugly, though. The code does its job by modifying
      the platform data where the clock dividers would be if the board file
      gave them. This is not how it's going to be in the future, but allows us
      to have quite simple patch and keep the backward compatibility.
      
      It also allows the developer to still give the exact dividers from the
      board file when there's need for that, as long as the panel driver does
      not override them.
      
      There are also other areas for improvement. For example, it would be
      better if the panel driver could ask for a DSI clock in a certain range,
      as, at least command mode panels, the panel can work fine with many
      different clock speeds.
      
      While the patch is not perfect, it allows us to remove the hardcoded
      clock dividers from the board file, making it easier to bring up a new
      panel and to use device tree from omapdss.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ee144e64
  9. 22 8月, 2012 2 次提交
  10. 16 8月, 2012 4 次提交
    • A
      OMAPDSS: DSI: Maintain copy of video mode timings in driver data · 0b3ffe39
      Archit Taneja 提交于
      The DSI driver currently relies on the omap_dss_device struct to receive the
      video mode timings requested by the panel driver. This makes the DSI interface
      driver dependent on the omap_dss_device struct.
      
      Make the DSI driver data maintain it's own video mode timings field. The panel
      driver is expected to call omapdss_dsi_set_videomode_timings() to configure the
      video mode timings before the interface is enabled.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      0b3ffe39
    • A
      OMAPDSS: DSI: Rename dsi_videomode_data to dsi_videomode_timings · 6b849375
      Archit Taneja 提交于
      The struct omap_dss_dsi_videomode_data holds fields which need to be configured
      for DSI to operate in video mode. Rename the struct to dsi_videomode_timings.
      
      One reason to do this is because most of the fields in the struct are timings
      related. The other reason is to create a generic op for output specific
      timings. This generic op can be considered as a way to set custom or private
      timings for the output.
      
      In the case of OMAP, DSI and RFBI require some more timings apart from the
      relgular DISPC timings. The structs omap_dss_videomode_timings and rfbi_timings
      can be considered as these output specific timings respectively.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      6b849375
    • A
      OMAPDSS: DSI: Maintain copy of operation mode in driver data · dca2b152
      Archit Taneja 提交于
      The DSI driver currently relies on the omap_dss_device struct to know the mode
      of operation of the DSI protocol(command or video mode). This makes the DSI
      interface driver dependent on the omap_dss_device struct.
      
      Make the DSI driver data maintain it's own operation mode field. The panel
      driver is expected to call omapdss_dsi_set_operation_mode() before the interface
      is enabled.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      dca2b152
    • A
      OMAPDSS: DSI: Maintain copy of pixel format in driver data · 02c3960b
      Archit Taneja 提交于
      The DSI driver currently relies on the omap_dss_device struct to receive the
      desired pixel format of the panel. This makes the DSI interface driver dependent
      on the omap_dss_device struct.
      
      Make the DSI driver data maintain it's own pixel format field. The panel driver
      is expected to call omapdss_dsi_set_pixel_format() to configure the pixel format
      before the interface is enabled.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      02c3960b
  11. 13 8月, 2012 3 次提交
    • A
      OMAPDSS: DSI: Update manager timings on a manual update · 55cd63ac
      Archit Taneja 提交于
      During a command mode update using DISPC video port, we may need to swap the
      connected overlay manager's width and height when 90 or 270 degree rotation is
      done via the panel by changing it's address mode.
      
      Call dss_mgr_set_timings() in update_screen_dispc() before starting the manager
      update. The new manager size is updated in the 'timings' field of DSI driver's
      private data via omapdss_dsi_set_size(). A panel driver is expected to call this
      when performing rotation.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      55cd63ac
    • A
      OMAPDSS: DSI: Add function to set panel size for command mode panels · e352574d
      Archit Taneja 提交于
      DSI command mode panels don't need to configure a full set of timings to
      configure DSI, they only require the width and the height of the panel in
      pixels.
      
      Use omapdss_dsi_set_size for command mode panels, omapdss_dsi_set_timings is
      meant for video mode panels. When performing rotation via chaning the address
      mode of the panel, we would need to swap width and height when doing 90 or 270
      rotation. Make sure that omapdss_dsi_set_size() makes the new width and height
      visible to DSI.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      e352574d
    • A
      OMAPDSS: DSI: Maintain own copy of timings in driver data · e67458a8
      Archit Taneja 提交于
      The DSI driver currently relies on the timings in omap_dss_device struct to
      configure the DISPC and DSI blocks accordingly. This makes the DSI interface
      driver dependent on the omap_dss_device struct.
      
      Make the DSI driver data maintain it's own timings field. A DSI video mode panel
      driver is expected to call omapdss_dsi_set_timings() to set these timings before
      the panel is enabled.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      e67458a8
  12. 08 7月, 2012 1 次提交
    • T
      OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n · 373b4365
      Tomi Valkeinen 提交于
      If runtime PM is not enabled in the kernel config, pm_runtime_get_sync()
      will always return 1 and pm_runtime_put_sync() will always return
      -ENOSYS. pm_runtime_get_sync() returning 1 presents no problem to the
      driver, but -ENOSYS from pm_runtime_put_sync() causes the driver to
      print a warning.
      
      One option would be to ignore errors returned by pm_runtime_put_sync()
      totally, as they only say that the call was unable to put the hardware
      into suspend mode.
      
      However, I chose to ignore the returned -ENOSYS explicitly, and print a
      warning for other errors, as I think we should get notified if the HW
      failed to go to suspend properly.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Jassi Brar <jaswinder.singh@linaro.org>
      Cc: Grazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      373b4365
  13. 29 6月, 2012 7 次提交
    • A
      OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in interface drivers · f476ae9d
      Archit Taneja 提交于
      Replace the DISPC fuctions used to configure LCD channel related manager
      parameters with dss_mgr_set_lcd_config() in APPLY. This function ensures that
      the DISPC registers are written at the right time by using the shadow register
      programming model.
      
      The LCD manager configurations is stored as a private data of manager in APPLY.
      It is treated as an extra info as it's the panel drivers which trigger this
      apply via interface drivers, and not a DSS2 user like omapfb or omapdrm.
      
      Storing LCD manager related properties in APPLY also prevents the need to refer
      to the panel connected to the manager for information. This helps in making the
      DSS driver less dependent on panel.
      
      A helper function is added to check whether the manager is LCD or TV. The direct
      DISPC register writes are removed from the interface drivers.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      f476ae9d
    • A
      OMAPDSS: DSI: Configure dss_lcd_mgr_config struct with lcd manager parameters · 7d2572f8
      Archit Taneja 提交于
      Create a dss_lcd_mgr_config struct instance in DSI. Fill up all the parameters
      of the struct with configurations held by the panel, and the configurations
      required by DSI.
      
      Use these to write to the DISPC registers. These direct register writes would be
      later replaced by a function which applies the configuration using the shadow
      register programming model.
      
      The function dsi_configure_dispc_clocks() is now called in
      dsi_display_init_dispc(), this lets all the lcd manager related configurations
      happen in the same place. The DISPC_DIVISORo register was written in
      dsi_configure_dispc_clock(), now it just fills up the dispc_clock_info parameter
      in mgr_config. The clock_info is written later in dsi_display_init_dispc().
      Signed-off-by: NArchit Taneja <archit@ti.com>
      7d2572f8
    • A
      OMAPDSS: DISPC: Change return type of dispc_mgr_set_clock_div() · f0d08f89
      Archit Taneja 提交于
      dipsc_mgr_set_clock div has an int return type to report errors or success.
      The function doesn't really check for errors and always returns 0. Change
      the return type to void.
      
      Checking for the correct DISPC clock divider ranges will be done when a DSS2
      user does a manager apply. This support will be added later.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      f0d08f89
    • A
      OMAPDSS: DSI: Fix HSYNC, VSYNC and DE polarities between DISPC and DSI · bd5a7b11
      Archit Taneja 提交于
      For DSI operation in videomode, DISPC logic levels for the signals HSYNC, VSYNC
      and DE need to be specified to DSI via the fields VP_HSYNC_POL, VP_VSYNC_POL and
      VP_DE_POL in DSI_CTRL registers.
      
      This information is completely internal to DSS as logic levels for the above
      signals hold no meaning on the DSI bus. Hence a DSI panel driver should be
      totally oblivious of these fields.
      
      Fix the logic levels/polarities in the DISPC and DSI registers to a default
      value. This is done by overriding these fields in omap_video_timings struct
      filled by the panel driver for DISPC, and use the equivalent default values
      when programming DSI_CTRL registers. Also, remove the redundant polarity related
      fields in omap_dss_dsi_videomode_data.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      bd5a7b11
    • A
      OMAPDSS: Remove passive matrix LCD support (part 3) · d21f43bc
      Archit Taneja 提交于
      Remove omap_lcd_display_type enum
      
      The enum omap_lcd_display_type is used to configure the lcd display type in
      DISPC. Remove this enum and always set display type to TFT by creating function
      dss_mgr_set_lcd_type_tft().
      Signed-off-by: NArchit Taneja <archit@ti.com>
      d21f43bc
    • A
      OMAPDSS: Remove passive matrix LCD support (part 1) · 6d523e7b
      Archit Taneja 提交于
      Remove clock constraints related to passive matrix displays.
      
      There is a constraint (pcd_min should be 3) for passive matrix displays. Remove
      this constraint in clock divider calculations as we won't support passive
      matrix displays any more.
      
      This cleans up the functions which calculate the clock dividers with DSI's PLL
      or DSS_FCLK as the clock source.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      6d523e7b
    • C
      OMAPDSS: Cleanup implementation of LCD channels · efa70b3b
      Chandrabhanu Mahapatra 提交于
      The current implementation of LCD channels and managers consists of a number of
      if-else construct which has been replaced by a simpler interface. A constant
      structure mgr_desc has been created in Display Controller (DISPC) module. The
      mgr_desc contains for each channel its name, irqs and  is initialized one time
      with all registers and their corresponding fields to be written to enable
      various features of Display Subsystem. This structure is later used by various
      functions of DISPC which simplifies the further implementation of LCD channels
      and its corresponding managers.
      Signed-off-by: NChandrabhanu Mahapatra <cmahapatra@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      efa70b3b