linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: linuxppc-dev@ozlabs.org
Subject: RFC: Could cpm2_clk_setup and cpm2_set_pin be exported ?
Date: Thu, 28 Aug 2008 17:57:13 +0200	[thread overview]
Message-ID: <200808281757.16903.laurentp@cse-semaphore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

Hi everybody,

I'm facing a situation where I need to call cpm2_clk_setup and cpm2_set_pin from a device driver compiled as a module. Before submitting a patch to export both functions, I'd like to make sure there isn't a cleaner way to implement the desired functionality without calling functions that are supposed to be used by board setup code.

The hardware is an Infineon SHDSL chip connected directly to 3 SCC ports of an MPC8248. The SHDSL ports roles can be set at runtime to Central Office or Remote Terminal (thing about a kind of master/slave configuration). SCC clock routing needs to configured at runtime to accommodate the ports roles (in one of the roles the SCC uses a baud rate generator, while in the other it receives the clock from the chip). Clocks are described in the device tree, so the driver does not hardcode clock values, but I need to call cpm2_clk_setup at runtime. Should this be done through board-supplied callbacks passed to the driver in a platform data structure (in which case I can't declare the device in the device tree as I'm doing now) or would it be acceptable to export cpm2_clk_setup ?

cpm2_set_pin is used for a similar purpose, as I have to setup BRG/CLK pins in input or output mode depending on the clock configuration. Additionally, cpm2_set_pin is also used to configure all inputs as outputs when the driver detects that the optional SDHSL module is not plugged in. Would it be safe to leave those pins as floating inputs, or could that potentially damage the MPC8248 ?

Thanks for your help.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2008-08-28 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28 15:57 Laurent Pinchart [this message]
2008-08-28 16:41 ` RFC: Could cpm2_clk_setup and cpm2_set_pin be exported ? Scott Wood
2008-08-28 17:07   ` Laurent Pinchart
2008-08-28 17:14     ` Scott Wood
2008-08-29  8:45       ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808281757.16903.laurentp@cse-semaphore.com \
    --to=laurentp@cse-semaphore.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).