summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: hda - Silence PM ops build warningLukas Wunner2018-03-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system sleep PM ops azx_suspend() and azx_resume() were previously called by vga_switcheroo, but commit 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller") removed their invocation. Unfortunately the commit neglected to update the #ifdef surrounding the two functions, so if CONFIG_PM_SLEEP is *not* enabled but all three of CONFIG_PM, CONFIG_VGA_SWITCHEROO and CONFIG_SND_HDA_CODEC_HDMI *are* enabled, the compiler now emits the following warning: sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function] static int azx_resume(struct device *dev) ^~~~~~~~~~ sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function] static int azx_suspend(struct device *dev) ^~~~~~~~~~~ Silence by updating the #ifdef. Because the #ifdef block now uses the same condition as the one immediately succeeding it, the two blocks can be collapsed together, shaving off another two lines. Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller") Reviewed-by: Takashi Iwai <tiwai@suse.de> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lukas Wunner <lukas@wunner.de> Link: https://patchwork.kernel.org/patch/10313441/ Link: https://patchwork.freedesktop.org/patch/msgid/b8e70e34a9acbd4f0a1a6c7673cea96888ae9503.1522323444.git.lukas@wunner.de
* drm: Fix uabi regression by allowing garbage mode->type from userspaceVille Syrjälä2018-03-231-1/+7
| | | | | | | | | | | | | | | | | | | | Apparently xf86-video-vmware leaves the mode->type uninitialized when feeding the mode to the kernel. Thus we have no choice but to accept the garbage in. We'll just ignore any of the bits we don't want. The mode type is just a hint anyway, and more useful for the kernel->userspace direction. Reported-by: Thomas Hellstrom <thomas@shipmail.org> CC: Thomas Hellstrom <thomas@shipmail.org> Cc: Adam Jackson <ajax@redhat.com> Cc: Alex Deucher <alexander.deucher@amd.com> Fixes: c6ed6dad5cfb ("drm/uapi: Validate the mode flags/type") References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180321211246.10152-1-ville.syrjala@linux.intel.com Tested-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* Merge airlied/drm-next into drm-misc-nextSean Paul2018-03-21763-33627/+68429
|\ | | | | | | | | | | Refresh -misc-next Signed-off-by: Sean Paul <seanpaul@chromium.org>
| * Merge tag 'omapdrm-4.17' of ↵Dave Airlie2018-03-2155-3831/+4277
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next omapdrm patches for v4.17 * Fix sparse warnings from omapdrm * HPD support for DVI connector * Big cleanup to remove static variables * tag 'omapdrm-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (69 commits) drm/omap: fix compile error when DPI is disabled drm/omap: fix compile error when debugfs is disabled drm: omapdrm: displays: panel-dsi-cm: Fix field access before set drm/omap: cleanup color space conversion drm/omap: Allow HDMI audio setup even if we do not have video configured drm/omap: fix maximum sizes drm/omap: add writeback funcs to dispc_ops drm/omap: fix scaling limits for WB drm/omap: fix WB height with interlace drm/omap: fix WBDELAYCOUNT with interlace drm/omap: fix WBDELAYCOUNT for HDMI drm/omap: set WB channel-in in wb_setup() drm/omap: Add pclk setting case when channel is DSS_WB drm/omap: dispc: disp_wb_setup to check return code drm/omap: remove leftover enums dt-bindings: display: add HPD gpio to DVI connector drm/omap: add HPD support to connector-dvi drm/omap: Init fbdev emulation only when we have displays drm/omap: cleanup fbdev init/free drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't called ...
| | * drm/omap: fix compile error when DPI is disabledTomi Valkeinen2018-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_OMAP2_DSS_DPI is disabled, compilation fails due to: drivers/gpu/drm/omapdrm/dss/dss.h:388:25: error: conflicting types for ‘port’ struct device_node *port, ^~~~ Fix this by renaming the first parameter correctly. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: fix compile error when debugfs is disabledTomi Valkeinen2018-03-141-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling with CONFIG_OMAP2_DSS_DEBUGFS disabled, build fails due to: drivers/gpu/drm/omapdrm/dss/dss.c:1474:10: error: ‘dss_debug_dump_clocks’ undeclared (first use in this function); did you mean ‘dispc_dump_clocks’? dss_debug_dump_clocks, dss); ^~~~~~~~~~~~~~~~~~~~~ dispc_dump_clocks Fix this by moving the required functions outside #if defined(CONFIG_OMAP2_DSS_DEBUGFS). In the long term, we perhaps want to try to get all the debugfs support left out if debugfs is not enabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm: omapdrm: displays: panel-dsi-cm: Fix field access before setLaurent Pinchart2018-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The driver accesses the ddata->in field before it gets set in the dsicm_connect() function. Use the local in pointer variable instead. Fixes: 7877632b4cd0 ("drm: omapdrm: displays: Get panel source at connect time") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: cleanup color space conversionTomi Valkeinen2018-03-011-15/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setup code for color space conversion is a bit messy. This patch cleans it up. For some reason the TRM uses values in YCrCb order, which is also used in the current driver, whereas everywhere else it's YCbCr (which also matches YUV order). This patch changes the tables to use the common order to avoid confusion. The tables are split into separate lines, and comments added for clarity. WB color conversion registers are similar but different than non-WB, but the same function was used to write both. It worked fine because the coef table was adjusted accordingly, but that was rather confusing. This patch adds a separate function to write the WB values so that the coef table can be written in an understandable way. Recalculation also showed that 'bcb' value in yuv-to-rgb conversion had been rounded wrongly, and it should be 516 instead of 517. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: Allow HDMI audio setup even if we do not have video configuredJyri Sarha2018-03-012-40/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow HDMI audio setup even if we do not have video configured. Audio will get configured at the same time with video if the video is configured soon enough. If it is not the audio DMA will timeout in couple of seconds and audio playback will be aborted. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: fix maximum sizesTomi Valkeinen2018-03-011-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We define max width and height in mode_config to 2048. These maximums affect many things, which are independent and depend on platform. We need to do more fine grained checks in the code paths for each component, and so the maximum values in mode_config should just be "big enough" to cover all use cases. Change the maximum width & height to 8192. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: add writeback funcs to dispc_opsTomi Valkeinen2018-03-013-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | Add writeback specific dispc functions to dispc_ops so that omapdrm can use them. Also move 'enum dss_writeback_channel' to the public omapdss.h for omapdrm. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: fix scaling limits for WBTomi Valkeinen2018-03-011-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WB has additional scaling limits when the output color format is one of the YUV formats. These limits are not handled at the moment, causing bad scaling and/or NULL dereference crash. This patchs adds the check so that dispc returns an error for bad scaling request. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: fix WB height with interlaceTomi Valkeinen2018-03-011-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using WB capture from interlaced source, we need to halve the picture heights correctly. Unfortunately the current dispc_ovl_setup_common() doesn't deal with interlace very neatly, so the end result is a bit messy. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Benoit Parrot <bparrot@ti.com>
| | * drm/omap: fix WBDELAYCOUNT with interlaceTomi Valkeinen2018-03-011-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | Vertical blanking needs to be halved on interlace modes. WBDELAYCOUNT was calculated without such halving, resulting in WBUNCOMPLETE errors. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Benoit Parrot <bparrot@ti.com>
| | * drm/omap: fix WBDELAYCOUNT for HDMITomi Valkeinen2018-03-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | For HDMI, WBDELAYCOUNT starts counting at the start of vsync, not at the start of vfp. This patch adjusts the wbdelay for HDMI accordingly. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: set WB channel-in in wb_setup()Tomi Valkeinen2018-03-012-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to know the WB channel-in in wb_setup() to be able to configure WB properly for capture mode. At the moment channel-in is set separately. This patch moves channel-in to wb_setup(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: Add pclk setting case when channel is DSS_WBBenoit Parrot2018-03-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In dispc_set_ovl_common() we need to initialize pclk to a valid value when we use WB in capture mode (i.e. mem_2_mem is false). Otherwise dispc_ovl_calc_scaling() fails. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: dispc: disp_wb_setup to check return codeBenoit Parrot2018-03-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dispc_wb_setup() calls dispc_ovl_setup_common() it does not check for failure but instead keeps on partially setting up WB. This causes the WB H/W to be partially initialized and yield unexpected behavior. Make sure return code is successful before proceeding. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: remove leftover enumsTomi Valkeinen2018-03-011-15/+0
| | | | | | | | | | | | | | | | | | | | | A few enums are not used anywhere, so remove them. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * dt-bindings: display: add HPD gpio to DVI connectorTomi Valkeinen2018-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add hpd-gpios property to dvi-connector.txt. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: add HPD support to connector-dviTomi Valkeinen2018-03-011-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | Add HPD support to the DVI connector driver. The code is almost identical to the HPD code in the HDMI connector driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: Init fbdev emulation only when we have displaysPeter Ujfalusi2018-03-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not try to init the fbdev if either num_crtcs or num_connectors is 0. In this case we do not have display so the fbdev init would fail anyways. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: cleanup fbdev init/freeTomi Valkeinen2018-03-013-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | omap_fbdev_init() and omap_fbdev_free() use priv->fbdev directly. However, omap_fbdev_init() returns the fbdev, and omap_drv.c also assigns the return value to priv->fbdev. This is slightly confusing. Clean this up by removing the omap_fbdev_init() return value, as we don't care whether fbdev init succeeded or not. Also change omap_drv.c to call omap_fbdev_free() always, and omap_fbdev_free() does the check if fbdev was initialized. While at it, rename omap_fbdev_free() to omap_fbdev_fini() to better match the "init" counterpart. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't calledTomi Valkeinen2018-03-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have no crtcs/connectors, fbdev init goes fine, but omap_fbdev_create() is never called. This means that omap_fbdev->bo is NULL and omap_fbdev_free() crashes. Add a check to omap_fbdev_free() to handle the NULL case. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| | * drm/omap: fbdev: avoid double initializer entryTomi Valkeinen2018-03-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning: drivers/gpu/drm/omapdrm/omap_fbdev.c:83:9: warning: Initializer entry defined twice drivers/gpu/drm/omapdrm/omap_fbdev.c:91:10: also defined here Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: fbdev: use 'screen_buffer' fieldTomi Valkeinen2018-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning: drivers/gpu/drm/omapdrm/omap_fbdev.c:191:26: warning: incorrect type in assignment (different address spaces) drivers/gpu/drm/omapdrm/omap_fbdev.c:191:26: expected char [noderef] <asn:2>*screen_base drivers/gpu/drm/omapdrm/omap_fbdev.c:191:26: got void * Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: acx565akm: use __be32 when reading statusTomi Valkeinen2018-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning: drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c:224:23: warning: cast to restricted __be32 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm/omap: reorganize locking in mgr_fld_writeTomi Valkeinen2018-03-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning: drivers/gpu/drm/omapdrm/dss/dispc.c:387:9: warning: context imbalance in 'mgr_fld_write' - different lock contexts for basic block Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| | * drm: omapdrm: venc: Allocate the venc private data structure dynamicallyLaurent Pinchart2018-03-011-204/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The venc private data structure is currently stored as a global variable. While no platform with multiple VENC encoders currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: sdi: Allocate the sdi private data structure dynamicallyLaurent Pinchart2018-03-011-65/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sdi private data structure is currently stored as a global variable. While no platform with multiple SDI encoders currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: hdmi5: Allocate the omap_hdmi data structure dynamicallyLaurent Pinchart2018-03-011-168/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The omap_hdmi private data structure is currently stored as a global variable. While no platform with multiple HDMI5 encoders currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: hdmi4: Allocate the omap_hdmi data structure dynamicallyLaurent Pinchart2018-03-014-166/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The omap_hdmi private data structure is currently stored as a global variable. While no platform with multiple HDMI4 encoders currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dispc: Allocate the dispc private data structure dynamicallyLaurent Pinchart2018-03-011-895/+1039
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dispc private data structure is currently stored as a global variable. While no platform with multiple DISPC currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API functionsLaurent Pinchart2018-03-019-110/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need to access the global DISPC private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DISPC private data dynamically). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operationsLaurent Pinchart2018-03-0115-196/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need to access the global DISPC private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DISPC private data dynamically). In order to allow the omapdrm side to call the dispc_ops with a DISPC pointer, we also introduce a new function dss_get_dispc() to retrieve the DISPC corresponding to the DSS. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Store dispc ops in dss_device structureLaurent Pinchart2018-03-016-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | Remove the global dispc ops variable by storing it in the dss_device structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Store DSS device pointer in the omapdrm private dataLaurent Pinchart2018-03-015-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dss_device is the top-level component in the omapdss driver. Give the omapdrm driver access to the dss_device pointer in order to obtain pointers to all other components from it. This requires a new global variable in the omapdss driver that will be removed when merging the omapdrm and omapdss drivers, but will already allow removal of several other global variables. As this partly duplicates the omapdss_is_initialized() API, reimplement it as an inline function wrapping omapdss_get_dss(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Pass omap_drm_private pointer to dss_mgr_opsLaurent Pinchart2018-03-015-40/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dss_mgr_ops operations implemented by the omapdrm side have to look up the omap_crtc objects from global variables as they are only passed a channel number. In order to remove global variables in the omapdrm driver pass the omap_drm_private pointer to the dss_mgr_ops. This requires storing a pointer to the omap_drm_private in a global variable on the DSS side as a temporary measure until the omapdrm and omapdss drivers get merged. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Pass omap_dss_device pointer to dss_mgr_*() functionsLaurent Pinchart2018-03-018-124/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dss_mgr_*() functions take a channel argument to identify the channel they operate on. This prevents the functions from accessing driver data structures without resorting to global variables. In an effort to remove global variables, pass the omap_dss_device pointer associated with the channel instead. This will be used to look up the omap_drm_private data structure to pass to the dss_mgr_ops. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dsi: Don't pass channel to dispc init/uninit functionsLaurent Pinchart2018-03-011-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dsi_display_init_dispc() and dsi_display_uninit_dispc() functions take a channel argument that is reduntant as it is always identical to the dsi->output.dispc_channel. Remove the argument and use the field directly in the functions to avoid misuse. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dsi: Store the struct device pointer in struct dsi_dataLaurent Pinchart2018-03-011-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | The dsi_data structure stores a pointer to a struct platform_device. The driver only uses the dev member of the platform device structure. Store the struct device pointer instead and use it directly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dsi: Use dev pointer directly in dsi_bind() functionLaurent Pinchart2018-03-011-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dsi_bind() function receives a pointer to a struct device that it casts to a struct platform_device, only to use the platform device's dev field through the code. Use the dev pointer directly. While at it rename the struct platform_device pointer dsidev to pdev to make it more explicit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dsi: Combine two commonly used inline functionsLaurent Pinchart2018-03-011-60/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dsi_get_dsidrv_data() and dsi_get_dsidev_from_dssdev() inline functions convert a struct omap_dss_device pointer to the corresponding struct platform_device, and a struct platform_device pointer to the corresponding struct dsi_data. They are nearly always called together without any use of the intermediate platform_device, so combine them into a single function. In the three locations where only dsi_get_dsidrv_data() is used, call dev_get_drvdata() directly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dsi: Pass the dsi_data pointer to internal functionsLaurent Pinchart2018-03-011-664/+564
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internal dsi functions take a pointer to the DSI platform_device and then cast it to a dsi_data pointer. That's pointless as the caller already has the dsi_data pointer. Pass it directly instead of the platform_device pointer. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Don't unnecessarily cast to dev to pdev and backLaurent Pinchart2018-03-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The dss_unbind() function casts the struct device pointer to a struct platform_device, only to later use the struct device pointer from platform_device. Don't cast at all. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Store the debugfs root directory in struct dss_deviceLaurent Pinchart2018-03-017-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | As part of an effort to remove the usage of global variables in the driver, store the debugfs root directory in the dss_device structure instead of a global variable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Store the registered plls array in struct dss_deviceLaurent Pinchart2018-03-017-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | As part of an effort to remove the usage of global variables in the driver, store the registered plls array in the dss_device structure instead of a global variable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Support passing private data to debugfs show handlersLaurent Pinchart2018-03-018-63/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To simplify implementation of debugfs seq_file show handlers, the driver passes the pointer to the show function through the debugfs_create_file data pointer. This prevents using the pointer to pass driver private data to the show handler, and requires all handlers to use global variables to access private data. To prepare for the removal of global private data in the driver, rework the debugfs infrastructure to allow passing a private data pointer to show handlers. The price to pay is explicit removal of debugfs files to free the internally allocated memory. This is desirable anyway as debugfs entries should be removed when a component driver is unbound, otherwise crashes will occur due to access to freed memory when the components will be dynamically allocated instead of stored in global variables. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Allocate the DSS private data structure dynamicallyLaurent Pinchart2018-03-011-155/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DSS private data structure is currently stored as a global variable. While no platform with multiple DSS devices currently exists nor is planned, this doesn't comply with the kernel device model and should thus be fixed. Allocate the DSS private data structure dynamically for each DSS instance and remove the global variable. All code that need access to the structure now retrieves it dynamically so we can remove the global variable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| | * drm: omapdrm: dss: Pass DSS pointer to remaining dss functionsLaurent Pinchart2018-03-014-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>