* Re: [PATCH] i2c: ocores: add gaisler to platform data [not found] <20200811134426.7613-1-mab@mab-labs.com> @ 2020-08-13 14:10 ` Peter Korsgaard [not found] ` <CALkjhPpF9wqaZGWQSZ9FphtcXD_obYubFX4te9xtcDdOP4M_gg@mail.gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Peter Korsgaard @ 2020-08-13 14:10 UTC (permalink / raw) To: Mohammed Billoo; +Cc: linux-i2c >>>>> "Mohammed" == Mohammed Billoo <mab@mab-labs.com> writes: Hi, Please send i2c patches to the linux-i2c mailing list as well, so the i2c maintainer can apply it. > There may be instances when the device tree is not suitable to interface > with the ocores implementation. For example, when the FPGA/ASIC is > not on the same silicon die (e.g. the communication between the CPU and > the FPGA/ASIC is over PCI), information about the ocore implementation, > such as whether the gaisler implementation is used, must be determined > during runtime. In this case, the client driver would prepopulate the > platform data during device instantiation. Thus, a boolean needs to be > added in the platform data, to instruct the i2c-ocores driver whether > the gaisler register callbacks should be used. > Signed-off-by: Mohammed Billoo <mab@mab-labs.com> > --- > drivers/i2c/busses/i2c-ocores.c | 4 ++++ > include/linux/platform_data/i2c-ocores.h | 1 + > 2 files changed, 5 insertions(+) > diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c > index f5fc75b65a19..0975f6797069 100644 > --- a/drivers/i2c/busses/i2c-ocores.c > +++ b/drivers/i2c/busses/i2c-ocores.c > @@ -647,6 +647,10 @@ static int ocores_i2c_probe(struct platform_device *pdev) > i2c-> bus_clock_khz = pdata->bus_khz; > else > i2c-> bus_clock_khz = 100; > + if (pdata->gaisler) { > + i2c->setreg = oc_setreg_grlib; > + i2c->getreg = oc_getreg_grlib; > + } > } else { > ret = ocores_i2c_of_probe(pdev, i2c); > if (ret) > diff --git a/include/linux/platform_data/i2c-ocores.h b/include/linux/platform_data/i2c-ocores.h > index e6326cbafe59..a3cb38f21417 100644 > --- a/include/linux/platform_data/i2c-ocores.h > +++ b/include/linux/platform_data/i2c-ocores.h > @@ -16,6 +16,7 @@ struct ocores_i2c_platform_data { > bool big_endian; /* registers are big endian */ > u8 num_devices; /* number of devices in the devices list */ > struct i2c_board_info const *devices; /* devices connected to the bus */ > + bool gaisler; /* implementation is gaisler */ NIT: Perhaps it would be nicer to place this after big_endian, as it is quite similar to that? A clearer comment could be "Use Gaisler GRLIB accessors" Other than that it looks good to me, thanks. Acked-by: Peter Korsgaard <peter@korsgaard.com> -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CALkjhPpF9wqaZGWQSZ9FphtcXD_obYubFX4te9xtcDdOP4M_gg@mail.gmail.com>]
[parent not found: <CALkjhPrz=0q+sKsB9Y=i4LCCuFVg-bGSzGDyAHaE-XE=qBrVXQ@mail.gmail.com>]
* Re: [PATCH] i2c: ocores: add gaisler to platform data [not found] ` <CALkjhPrz=0q+sKsB9Y=i4LCCuFVg-bGSzGDyAHaE-XE=qBrVXQ@mail.gmail.com> @ 2020-08-13 16:29 ` Peter Korsgaard 2020-08-13 18:42 ` Wolfram Sang 0 siblings, 1 reply; 3+ messages in thread From: Peter Korsgaard @ 2020-08-13 16:29 UTC (permalink / raw) To: Mohammed Billoo; +Cc: linux-i2c >>>>> "Mohammed" == Mohammed Billoo <mab@mab-labs.com> writes: Hi, > And the answer is a patch series (I couldn't figure out the appropriate > term to google). Indeed. Please send a patch series for the needed changes to linux-i2c and put me in CC. > Also, it looks like the linux-i2c mailing list no longer exists? It does. Perhaps you need to subscribe to be able to post? My earlier reply did make it to the list: https://marc.info/?l=linux-i2c&m=159732786421840&w=2 > On Thu, Aug 13, 2020 at 10:33 AM Mohammed Billoo <mab@mab-labs.com> wrote: >> Peter, >> >> Thanks for your comment. Would you like me to resubmit the patch with your >> suggestions? >> >> Also, we'll need to incorporate big/little-endian with the GRLIB accessors >> as well (I ran into an issue where a vendor-specific AHB bridge had >> endianness conversion, but the IP designer didn't realize that and so I >> needed an accessor for both GRLIB and big-endian). I'm not sure what the >> best-practice for multiple patches is. Should I submit patch N assuming >> patch N-1 was applied? -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: ocores: add gaisler to platform data 2020-08-13 16:29 ` Peter Korsgaard @ 2020-08-13 18:42 ` Wolfram Sang 0 siblings, 0 replies; 3+ messages in thread From: Wolfram Sang @ 2020-08-13 18:42 UTC (permalink / raw) To: Peter Korsgaard; +Cc: Mohammed Billoo, linux-i2c [-- Attachment #1: Type: text/plain, Size: 81 bytes --] > It does. Perhaps you need to subscribe to be able to post? My earlier Nope. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-13 18:42 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20200811134426.7613-1-mab@mab-labs.com> 2020-08-13 14:10 ` [PATCH] i2c: ocores: add gaisler to platform data Peter Korsgaard [not found] ` <CALkjhPpF9wqaZGWQSZ9FphtcXD_obYubFX4te9xtcDdOP4M_gg@mail.gmail.com> [not found] ` <CALkjhPrz=0q+sKsB9Y=i4LCCuFVg-bGSzGDyAHaE-XE=qBrVXQ@mail.gmail.com> 2020-08-13 16:29 ` Peter Korsgaard 2020-08-13 18:42 ` Wolfram Sang
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.