lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [EXTERNAL] Re: [RESEND PATCH] net: ethernet: ti: davinci_mdio: Add workaround for errata i2329
> Thanks for reviewing the patch. Since mdiobb_{read,write}() are exported, I
> can invoke these in my mdio read/write implementation. I will rework and
> send the v2 patch

What you should do is fill a struct mdiobb_ops and pass it to
alloc_mdio_bitbang(). It looks like you can provide:

struct mdiobb_ops {
struct module *owner;

/* Set the Management Data Clock high if level is one,
* low if level is zero.
*/
void (*set_mdc)(struct mdiobb_ctrl *ctrl, int level);

/* Configure the Management Data I/O pin as an input if
* "output" is zero, or an output if "output" is one.
*/
void (*set_mdio_dir)(struct mdiobb_ctrl *ctrl, int output);

/* Set the Management Data I/O pin high if value is one,
* low if "value" is zero. This may only be called
* when the MDIO pin is configured as an output.
*/
void (*set_mdio_data)(struct mdiobb_ctrl *ctrl, int value);

/* Retrieve the state Management Data I/O pin. */
int (*get_mdio_data)(struct mdiobb_ctrl *ctrl);
};

Look at ravb_mdio_init() for an example, and there are a few others.

Andrew

\
 
 \ /
  Last update: 2022-08-09 19:11    [W:0.145 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site