18c2ecf20Sopenharmony_ci/************************************************************************** 28c2ecf20Sopenharmony_ci * Copyright (c) 2009-2011, Intel Corporation. 38c2ecf20Sopenharmony_ci * All Rights Reserved. 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 68c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 78c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 88c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 98c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 108c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice (including the next 138c2ecf20Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 148c2ecf20Sopenharmony_ci * Software. 158c2ecf20Sopenharmony_ci * 168c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 178c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 188c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 198c2ecf20Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 208c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 218c2ecf20Sopenharmony_ci * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 228c2ecf20Sopenharmony_ci * SOFTWARE. 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * Authors: 258c2ecf20Sopenharmony_ci * Benjamin Defnet <benjamin.r.defnet@intel.com> 268c2ecf20Sopenharmony_ci * Rajesh Poornachandran <rajesh.poornachandran@intel.com> 278c2ecf20Sopenharmony_ci * Massively reworked 288c2ecf20Sopenharmony_ci * Alan Cox <alan@linux.intel.com> 298c2ecf20Sopenharmony_ci */ 308c2ecf20Sopenharmony_ci#ifndef _PSB_POWERMGMT_H_ 318c2ecf20Sopenharmony_ci#define _PSB_POWERMGMT_H_ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#include <linux/pci.h> 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_cistruct device; 368c2ecf20Sopenharmony_cistruct drm_device; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_civoid gma_power_init(struct drm_device *dev); 398c2ecf20Sopenharmony_civoid gma_power_uninit(struct drm_device *dev); 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci/* 428c2ecf20Sopenharmony_ci * The kernel bus power management will call these functions 438c2ecf20Sopenharmony_ci */ 448c2ecf20Sopenharmony_ciint gma_power_suspend(struct device *dev); 458c2ecf20Sopenharmony_ciint gma_power_resume(struct device *dev); 468c2ecf20Sopenharmony_ciint gma_power_thaw(struct device *dev); 478c2ecf20Sopenharmony_ciint gma_power_freeze(struct device *dev); 488c2ecf20Sopenharmony_ciint gma_power_restore(struct device *_dev); 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci/* 518c2ecf20Sopenharmony_ci * These are the functions the driver should use to wrap all hw access 528c2ecf20Sopenharmony_ci * (i.e. register reads and writes) 538c2ecf20Sopenharmony_ci */ 548c2ecf20Sopenharmony_cibool gma_power_begin(struct drm_device *dev, bool force); 558c2ecf20Sopenharmony_civoid gma_power_end(struct drm_device *dev); 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci/* 588c2ecf20Sopenharmony_ci * Use this function to do an instantaneous check for if the hw is on. 598c2ecf20Sopenharmony_ci * Only use this in cases where you know the mutex is already held such 608c2ecf20Sopenharmony_ci * as in irq install/uninstall and you need to 618c2ecf20Sopenharmony_ci * prevent a deadlock situation. Otherwise use gma_power_begin(). 628c2ecf20Sopenharmony_ci */ 638c2ecf20Sopenharmony_cibool gma_power_is_on(struct drm_device *dev); 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci/* 668c2ecf20Sopenharmony_ci * GFX-Runtime PM callbacks 678c2ecf20Sopenharmony_ci */ 688c2ecf20Sopenharmony_ciint psb_runtime_suspend(struct device *dev); 698c2ecf20Sopenharmony_ciint psb_runtime_resume(struct device *dev); 708c2ecf20Sopenharmony_ciint psb_runtime_idle(struct device *dev); 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#endif /*_PSB_POWERMGMT_H_*/ 73