From patchwork Thu Mar 7 05:31:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 2230311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CDEBA3FC8F for ; Thu, 7 Mar 2013 05:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750804Ab3CGFcI (ORCPT ); Thu, 7 Mar 2013 00:32:08 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:58971 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800Ab3CGFcH (ORCPT ); Thu, 7 Mar 2013 00:32:07 -0500 Received: by mail-pb0-f43.google.com with SMTP id md12so89058pbc.30 for ; Wed, 06 Mar 2013 21:32:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=5V6NyOTwmviCFL6AnlW4uHrmquLFrZxyMZEmaTsrDes=; b=F36JIGQAjpkLlPCuE1mX5ySxbyjh89gT5uZoRxYcyNWbp25TDcKnjH3DcmgEJeiPHO JR7WSxZ/yTVOVshlZvxh0ilSO4W8e06YdUApGWQ91YOxHlW6TWZEkbwCLOmVLpk1g3sI JnDeUvsDzYcXkjlAUa7Dil3HpmiqquHIv1ipfKX9h6hJMuMC+NuMHKvNqugwj4u6AOu2 A7qZBKmS3tFqKabBXeCD6VuMOaez9ogTH4jNwwG4zK6T6ckwcJOdOBxsCa8SjnHj0Gox IbdWJfM5RFUSsa5NEpa0V24paPrfNTC5gdqmcjRFPIP3+dflJ/Vv1QkXr5eLCSntqeju cP5Q== X-Received: by 10.68.75.72 with SMTP id a8mr51075094pbw.143.1362634327397; Wed, 06 Mar 2013 21:32:07 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id b9sm387951pba.6.2013.03.06.21.32.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Mar 2013 21:32:06 -0800 (PST) From: Shaik Ameer Basha To: linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, shaik.samsung@gmail.com Subject: [PATCH] ARM: SAMSUNG: Set clock parent if provided Date: Thu, 7 Mar 2013 11:01:41 +0530 Message-Id: <1362634301-9706-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org s3c_set_clksrc() updates the clock source as per u-boot settings. This patch adds the functionality to overwrite u-boot settings, if user provides the clock parent field. In case of wrong source provided by the user, it will retain the u-boot settings. Signed-off-by: Shaik Ameer Basha --- arch/arm/plat-samsung/clock-clksrc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c index 786a410..4fecd80 100644 --- a/arch/arm/plat-samsung/clock-clksrc.c +++ b/arch/arm/plat-samsung/clock-clksrc.c @@ -150,7 +150,12 @@ void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk, bool announce) return; } - clk->clk.parent = srcs->sources[clksrc]; + if (clk->clk.parent) { + if (s3c_setparent_clksrc(&clk->clk, clk->clk.parent)) + clk->clk.parent = srcs->sources[clksrc]; + } else { + clk->clk.parent = srcs->sources[clksrc]; + } if (announce) printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",