···11+/*22+ * Copyright (C) 2013 Red Hat33+ * Author: Rob Clark <robdclark@gmail.com>44+ *55+ * This program is free software; you can redistribute it and/or modify it66+ * under the terms of the GNU General Public License version 2 as published by77+ * the Free Software Foundation.88+ *99+ * This program is distributed in the hope that it will be useful, but WITHOUT1010+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or1111+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for1212+ * more details.1313+ *1414+ * You should have received a copy of the GNU General Public License along with1515+ * this program. If not, see <http://www.gnu.org/licenses/>.1616+ */1717+1818+#ifndef __MSM_KMS_H__1919+#define __MSM_KMS_H__2020+2121+#include <linux/clk.h>2222+#include <linux/regulator/consumer.h>2323+2424+#include "msm_drv.h"2525+2626+/* As there are different display controller blocks depending on the2727+ * snapdragon version, the kms support is split out and the appropriate2828+ * implementation is loaded at runtime. The kms module is responsible2929+ * for constructing the appropriate planes/crtcs/encoders/connectors.3030+ */3131+struct msm_kms_funcs {3232+ /* hw initialization: */3333+ int (*hw_init)(struct msm_kms *kms);3434+ /* irq handling: */3535+ void (*irq_preinstall)(struct msm_kms *kms);3636+ int (*irq_postinstall)(struct msm_kms *kms);3737+ void (*irq_uninstall)(struct msm_kms *kms);3838+ irqreturn_t (*irq)(struct msm_kms *kms);3939+ int (*enable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);4040+ void (*disable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);4141+ /* misc: */4242+ const struct msm_format *(*get_format)(struct msm_kms *kms, uint32_t format);4343+ long (*round_pixclk)(struct msm_kms *kms, unsigned long rate,4444+ struct drm_encoder *encoder);4545+ /* cleanup: */4646+ void (*preclose)(struct msm_kms *kms, struct drm_file *file);4747+ void (*destroy)(struct msm_kms *kms);4848+};4949+5050+struct msm_kms {5151+ const struct msm_kms_funcs *funcs;5252+};5353+5454+struct msm_kms *mdp4_kms_init(struct drm_device *dev);5555+5656+#endif /* __MSM_KMS_H__ */