cregit-Linux how code gets into the kernel

Release 4.11 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c

/*
 * linux/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
 *
 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
 *              http://www.samsung.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include "s5p_mfc_common.h"
#include "s5p_mfc_debug.h"
#include "s5p_mfc_pm.h"


static struct s5p_mfc_pm *pm;

static struct s5p_mfc_dev *p_dev;

static atomic_t clk_ref;


int s5p_mfc_init_pm(struct s5p_mfc_dev *dev) { int i; pm = &dev->pm; p_dev = dev; pm->num_clocks = dev->variant->num_clocks; pm->clk_names = dev->variant->clk_names; pm->device = &dev->plat_dev->dev; pm->clock_gate = NULL; /* clock control */ for (i = 0; i < pm->num_clocks; i++) { pm->clocks[i] = devm_clk_get(pm->device, pm->clk_names[i]); if (IS_ERR(pm->clocks[i])) { mfc_err("Failed to get clock: %s\n", pm->clk_names[i]); return PTR_ERR(pm->clocks[i]); } } if (dev->variant->use_clock_gating) pm->clock_gate = pm->clocks[0]; pm_runtime_enable(pm->device); atomic_set(&clk_ref, 0); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Marek Szyprowski8649.43%233.33%
Kamil Debski6336.21%233.33%
Jacek Anaszewski2313.22%116.67%
Javier Martinez Canillas21.15%116.67%
Total174100.00%6100.00%


void s5p_mfc_final_pm(struct s5p_mfc_dev *dev) { pm_runtime_disable(pm->device); }

Contributors

PersonTokensPropCommitsCommitProp
Kamil Debski17100.00%1100.00%
Total17100.00%1100.00%


int s5p_mfc_clock_on(void) { atomic_inc(&clk_ref); mfc_debug(3, "+ %d\n", atomic_read(&clk_ref)); return clk_enable(pm->clock_gate); }

Contributors

PersonTokensPropCommitsCommitProp
Kamil Debski3294.12%133.33%
Andrzej Hajda12.94%133.33%
Marek Szyprowski12.94%133.33%
Total34100.00%3100.00%


void s5p_mfc_clock_off(void) { atomic_dec(&clk_ref); mfc_debug(3, "- %d\n", atomic_read(&clk_ref)); clk_disable(pm->clock_gate); }

Contributors

PersonTokensPropCommitsCommitProp
Kamil Debski3296.97%150.00%
Andrzej Hajda13.03%150.00%
Total33100.00%2100.00%


int s5p_mfc_power_on(void) { int i, ret = 0; ret = pm_runtime_get_sync(pm->device); if (ret < 0) return ret; /* clock control */ for (i = 0; i < pm->num_clocks; i++) { ret = clk_prepare_enable(pm->clocks[i]); if (ret < 0) { mfc_err("clock prepare failed for clock: %s\n", pm->clk_names[i]); i++; goto err; } } /* prepare for software clock gating */ clk_disable(pm->clock_gate); return 0; err: while (--i > 0) clk_disable_unprepare(pm->clocks[i]); pm_runtime_put(pm->device); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Marek Szyprowski11489.06%375.00%
Kamil Debski1410.94%125.00%
Total128100.00%4100.00%


int s5p_mfc_power_off(void) { int i; /* finish software clock gating */ clk_enable(pm->clock_gate); for (i = 0; i < pm->num_clocks; i++) clk_disable_unprepare(pm->clocks[i]); return pm_runtime_put_sync(pm->device); }

Contributors

PersonTokensPropCommitsCommitProp
Marek Szyprowski3670.59%375.00%
Kamil Debski1529.41%125.00%
Total51100.00%4100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Marek Szyprowski23749.89%436.36%
Kamil Debski20944.00%218.18%
Jacek Anaszewski234.84%19.09%
Javier Martinez Canillas20.42%19.09%
Andrzej Hajda20.42%19.09%
Sachin Kamat10.21%19.09%
Mauro Carvalho Chehab10.21%19.09%
Total475100.00%11100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.